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
1 changed files with 1 additions and 2 deletions
|
@ -152,9 +152,8 @@ async def async_setup_entry(
|
|||
dev_reg = dr.async_get(hass)
|
||||
dev_ids = {
|
||||
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
|
||||
if identifier[0] == DOMAIN
|
||||
}
|
||||
if not dev_ids:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue