mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Avoid linear search of entity registry in mikrotik (#109639)
This commit is contained in:
parent
3531444e2e
commit
babfdaac54
@ -34,11 +34,10 @@ async def async_setup_entry(
|
|||||||
registry = er.async_get(hass)
|
registry = er.async_get(hass)
|
||||||
|
|
||||||
# Restore clients that is not a part of active clients list.
|
# Restore clients that is not a part of active clients list.
|
||||||
for entity in registry.entities.values():
|
for entity in registry.entities.get_entries_for_config_entry_id(
|
||||||
if (
|
config_entry.entry_id
|
||||||
entity.config_entry_id == config_entry.entry_id
|
):
|
||||||
and entity.domain == DEVICE_TRACKER
|
if entity.domain == DEVICE_TRACKER:
|
||||||
):
|
|
||||||
if (
|
if (
|
||||||
entity.unique_id in coordinator.api.devices
|
entity.unique_id in coordinator.api.devices
|
||||||
or entity.unique_id not in coordinator.api.all_devices
|
or entity.unique_id not in coordinator.api.all_devices
|
||||||
|
Loading…
x
Reference in New Issue
Block a user