Adapt unifi to new device registry API (#176956)

This commit is contained in:
Erik Montnemery
2026-07-22 08:50:20 +02:00
committed by GitHub
parent 63f5166071
commit 149fca4900
@@ -168,12 +168,10 @@ class UnifiEntityLoader:
) -> None:
"""Remove a stale client's tracker entity and its device."""
entity_registry.async_remove(entity_id)
if device := device_registry.async_get_device(
connections={(dr.CONNECTION_NETWORK_MAC, mac)}
if device := device_registry.async_get_device_by_connection(
(dr.CONNECTION_NETWORK_MAC, mac), self.hub.config.entry.entry_id
):
device_registry.async_update_device(
device.id, remove_config_entry_id=self.hub.config.entry.entry_id
)
device_registry.async_remove_device(device.id)
@callback
def register_platform(