Avoid linear search in gpslogger to find devices (#114811)

This commit is contained in:
J. Nick Koston 2024-04-04 09:27:24 -10:00 committed by GitHub
parent a83d5e4071
commit 9189cd5ec2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,9 +48,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] == GPL_DOMAIN
}
if not dev_ids:
return