Avoid linear search of entity registry in huawei_lte (#109637)
This commit is contained in:
parent
13a5038c17
commit
3531444e2e
1 changed files with 4 additions and 5 deletions
|
@ -70,11 +70,10 @@ async def async_setup_entry(
|
||||||
track_wired_clients = router.config_entry.options.get(
|
track_wired_clients = router.config_entry.options.get(
|
||||||
CONF_TRACK_WIRED_CLIENTS, DEFAULT_TRACK_WIRED_CLIENTS
|
CONF_TRACK_WIRED_CLIENTS, DEFAULT_TRACK_WIRED_CLIENTS
|
||||||
)
|
)
|
||||||
for entity in registry.entities.values():
|
for entity in registry.entities.get_entries_for_config_entry_id(
|
||||||
if (
|
config_entry.entry_id
|
||||||
entity.domain == DEVICE_TRACKER_DOMAIN
|
|
||||||
and entity.config_entry_id == config_entry.entry_id
|
|
||||||
):
|
):
|
||||||
|
if entity.domain == DEVICE_TRACKER_DOMAIN:
|
||||||
mac = entity.unique_id.partition("-")[2]
|
mac = entity.unique_id.partition("-")[2]
|
||||||
# Do not add known wired clients if not tracking them (any more)
|
# Do not add known wired clients if not tracking them (any more)
|
||||||
skip = False
|
skip = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue