mirror of
https://github.com/home-assistant/core.git
synced 2026-08-03 20:24:55 +02:00
Adapt unifiprotect to new device registry API (#176957)
This commit is contained in:
@@ -488,14 +488,12 @@ class ProtectData:
|
||||
@callback
|
||||
def _async_remove_device(self, device: ProtectAdoptableDeviceModel) -> None:
|
||||
registry = dr.async_get(self._hass)
|
||||
device_entry = registry.async_get_device(
|
||||
connections={(dr.CONNECTION_NETWORK_MAC, device.mac)}
|
||||
device_entry = registry.async_get_device_by_connection(
|
||||
(dr.CONNECTION_NETWORK_MAC, device.mac), self._entry.entry_id
|
||||
)
|
||||
if device_entry:
|
||||
_LOGGER.debug("Device removed: %s", device.id)
|
||||
registry.async_update_device(
|
||||
device_entry.id, remove_config_entry_id=self._entry.entry_id
|
||||
)
|
||||
registry.async_remove_device(device_entry.id)
|
||||
|
||||
@callback
|
||||
def _async_update_device(
|
||||
|
||||
Reference in New Issue
Block a user