Avoid linear search in owntracks to find devices (#114812)

This commit is contained in:
J. Nick Koston 2024-04-04 09:26:58 -10:00 committed by GitHub
parent c798128ef1
commit c7d1319acf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,9 +30,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] == OT_DOMAIN
} }
entities = [] entities = []