mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Avoid linear search of entity registry in lcn (#109638)
This commit is contained in:
parent
6ccf82d7b1
commit
13a5038c17
@ -286,7 +286,8 @@ def purge_device_registry(
|
|||||||
|
|
||||||
# Find all devices that are referenced in the entity registry.
|
# Find all devices that are referenced in the entity registry.
|
||||||
references_entities = {
|
references_entities = {
|
||||||
entry.device_id for entry in entity_registry.entities.values()
|
entry.device_id
|
||||||
|
for entry in entity_registry.entities.get_entries_for_config_entry_id(entry_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find device that references the host.
|
# Find device that references the host.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user