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:
J. Nick Koston 2024-04-03 21:09:47 -10:00 committed by GitHub
parent 15a821f6ac
commit 2b06168573
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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