Add MAC to WLED device (#63349)

pull/63377/head
Paulus Schoutsen 2022-01-04 04:49:15 -08:00 committed by GitHub
parent 1bfa2a9b25
commit e201293848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
"""Models for WLED."""
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
@ -15,6 +16,9 @@ class WLEDEntity(CoordinatorEntity):
def device_info(self) -> DeviceInfo:
"""Return device information about this WLED device."""
return DeviceInfo(
connections={
(CONNECTION_NETWORK_MAC, self.coordinator.data.info.mac_address)
},
identifiers={(DOMAIN, self.coordinator.data.info.mac_address)},
name=self.coordinator.data.info.name,
manufacturer=self.coordinator.data.info.brand,