mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Use generator instead of single-list-unpack in PurpleAir config flow (#84922)
This commit is contained in:
parent
c6a0c7eccc
commit
82977a43d3
@ -126,11 +126,11 @@ def async_get_sensor_index(
|
|||||||
Note that this method expects that there will always be a single sensor index per
|
Note that this method expects that there will always be a single sensor index per
|
||||||
DeviceEntry.
|
DeviceEntry.
|
||||||
"""
|
"""
|
||||||
[sensor_index] = [
|
sensor_index = next(
|
||||||
sensor_index
|
sensor_index
|
||||||
for sensor_index in config_entry.options[CONF_SENSOR_INDICES]
|
for sensor_index in config_entry.options[CONF_SENSOR_INDICES]
|
||||||
if (DOMAIN, str(sensor_index)) in device_entry.identifiers
|
if (DOMAIN, str(sensor_index)) in device_entry.identifiers
|
||||||
]
|
)
|
||||||
|
|
||||||
return cast(int, sensor_index)
|
return cast(int, sensor_index)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user