From 82977a43d3b33f830fca5d0d5eb0090536c13764 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Sat, 31 Dec 2022 13:07:12 -0700 Subject: [PATCH] Use generator instead of single-list-unpack in PurpleAir config flow (#84922) --- homeassistant/components/purpleair/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/purpleair/config_flow.py b/homeassistant/components/purpleair/config_flow.py index 3b5720434b4..28744e952ab 100644 --- a/homeassistant/components/purpleair/config_flow.py +++ b/homeassistant/components/purpleair/config_flow.py @@ -126,11 +126,11 @@ def async_get_sensor_index( Note that this method expects that there will always be a single sensor index per DeviceEntry. """ - [sensor_index] = [ + sensor_index = next( sensor_index for sensor_index in config_entry.options[CONF_SENSOR_INDICES] if (DOMAIN, str(sensor_index)) in device_entry.identifiers - ] + ) return cast(int, sensor_index)