Skip to content
Snippets Groups Projects
Unverified Commit 383a820a authored by epenet's avatar epenet Committed by GitHub
Browse files

Use DeviceInfo in switcher-kis (#58579)

parent f2169ba1
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ from homeassistant.helpers import ( ...@@ -23,6 +23,7 @@ from homeassistant.helpers import (
entity_platform, entity_platform,
) )
from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity from homeassistant.helpers.update_coordinator import CoordinatorEntity
...@@ -92,11 +93,11 @@ class SwitcherBaseSwitchEntity(CoordinatorEntity, SwitchEntity): ...@@ -92,11 +93,11 @@ class SwitcherBaseSwitchEntity(CoordinatorEntity, SwitchEntity):
# Entity class attributes # Entity class attributes
self._attr_name = coordinator.name self._attr_name = coordinator.name
self._attr_unique_id = f"{coordinator.device_id}-{coordinator.mac_address}" self._attr_unique_id = f"{coordinator.device_id}-{coordinator.mac_address}"
self._attr_device_info = { self._attr_device_info = DeviceInfo(
"connections": { connections={
(device_registry.CONNECTION_NETWORK_MAC, coordinator.mac_address) (device_registry.CONNECTION_NETWORK_MAC, coordinator.mac_address)
} }
} )
@callback @callback
def _handle_coordinator_update(self) -> None: def _handle_coordinator_update(self) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment