mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Avoid linear search in traccar to find devices (#114817)
* Avoid linear search in traccar to find devices * remove useless check
This commit is contained in:
parent
15a821f6ac
commit
2b06168573
@ -152,9 +152,8 @@ async def async_setup_entry(
|
|||||||
dev_reg = dr.async_get(hass)
|
dev_reg = dr.async_get(hass)
|
||||||
dev_ids = {
|
dev_ids = {
|
||||||
identifier[1]
|
identifier[1]
|
||||||
for device in dev_reg.devices.values()
|
for device in dev_reg.devices.get_devices_for_config_entry_id(entry.entry_id)
|
||||||
for identifier in device.identifiers
|
for identifier in device.identifiers
|
||||||
if identifier[0] == DOMAIN
|
|
||||||
}
|
}
|
||||||
if not dev_ids:
|
if not dev_ids:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user