Avoid linear search of entity registry in lcn (#109638)

This commit is contained in:
J. Nick Koston 2024-02-04 14:12:43 -06:00 committed by GitHub
parent 6ccf82d7b1
commit 13a5038c17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -286,7 +286,8 @@ def purge_device_registry(
# Find all devices that are referenced in the entity registry.
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.