mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Avoid linear search in purpleair to find devices (#114816)
This commit is contained in:
parent
d7153d525f
commit
0710f4c661
@ -115,8 +115,9 @@ def async_get_remove_sensor_options(
|
||||
device_registry = dr.async_get(hass)
|
||||
return [
|
||||
SelectOptionDict(value=device_entry.id, label=cast(str, device_entry.name))
|
||||
for device_entry in device_registry.devices.values()
|
||||
if config_entry.entry_id in device_entry.config_entries
|
||||
for device_entry in device_registry.devices.get_devices_for_config_entry_id(
|
||||
config_entry.entry_id
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user