mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Remove tedee device safely from registry (#107529)
remove device safely from registry
This commit is contained in:
parent
cc67fd8a3c
commit
080484f2f6
@ -121,7 +121,10 @@ class TedeeApiCoordinator(DataUpdateCoordinator[dict[int, TedeeLock]]):
|
|||||||
if device := device_registry.async_get_device(
|
if device := device_registry.async_get_device(
|
||||||
identifiers={(DOMAIN, str(lock_id))}
|
identifiers={(DOMAIN, str(lock_id))}
|
||||||
):
|
):
|
||||||
device_registry.async_remove_device(device.id)
|
device_registry.async_update_device(
|
||||||
|
device_id=device.id,
|
||||||
|
remove_config_entry_id=self.config_entry.entry_id,
|
||||||
|
)
|
||||||
|
|
||||||
# add new locks
|
# add new locks
|
||||||
if new_locks := current_locks - self._locks_last_update:
|
if new_locks := current_locks - self._locks_last_update:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user