Avoid linear search of the device registry in deconz (#114803)
This commit is contained in:
parent
c18ff39540
commit
aa52688d4b
1 changed files with 3 additions and 2 deletions
|
@ -160,8 +160,9 @@ async def async_remove_orphaned_entries_service(hub: DeconzHub) -> None:
|
|||
entities_to_be_removed = []
|
||||
devices_to_be_removed = [
|
||||
entry.id
|
||||
for entry in device_registry.devices.values()
|
||||
if hub.config_entry.entry_id in entry.config_entries
|
||||
for entry in device_registry.devices.get_devices_for_config_entry_id(
|
||||
hub.config_entry.entry_id
|
||||
)
|
||||
]
|
||||
|
||||
# Don't remove the Gateway host entry
|
||||
|
|
Loading…
Add table
Reference in a new issue