Avoid linear search of entity registry in guardian (#109634)
This commit is contained in:
parent
b24b4fc237
commit
c988d3d427
1 changed files with 4 additions and 3 deletions
|
@ -48,9 +48,10 @@ def async_finish_entity_domain_replacements(
|
||||||
try:
|
try:
|
||||||
[registry_entry] = [
|
[registry_entry] = [
|
||||||
registry_entry
|
registry_entry
|
||||||
for registry_entry in ent_reg.entities.values()
|
for registry_entry in er.async_entries_for_config_entry(
|
||||||
if registry_entry.config_entry_id == entry.entry_id
|
ent_reg, entry.entry_id
|
||||||
and registry_entry.domain == strategy.old_domain
|
)
|
||||||
|
if registry_entry.domain == strategy.old_domain
|
||||||
and registry_entry.unique_id == strategy.old_unique_id
|
and registry_entry.unique_id == strategy.old_unique_id
|
||||||
]
|
]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Add table
Reference in a new issue