Remove tedee device safely from registry (#107529)

remove device safely from registry
This commit is contained in:
Josef Zweck 2024-01-08 13:10:16 +01:00 committed by GitHub
parent cc67fd8a3c
commit 080484f2f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,7 +121,10 @@ class TedeeApiCoordinator(DataUpdateCoordinator[dict[int, TedeeLock]]):
if device := device_registry.async_get_device(
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
if new_locks := current_locks - self._locks_last_update: