mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 17:04:04 -04:00
Adapt unifi to new device registry API (#176956)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user