diff --git a/homeassistant/components/flume/util.py b/homeassistant/components/flume/util.py index b943124b877c5e671a1ade4592bce42ff966ed86..58b3920c9be8950d92eaafae62cf8c26d04c3dcd 100644 --- a/homeassistant/components/flume/util.py +++ b/homeassistant/components/flume/util.py @@ -14,5 +14,6 @@ def get_valid_flume_devices(flume_devices: FlumeDeviceList) -> list[dict[str, An return [ device for device in flume_devices.device_list - if KEY_DEVICE_LOCATION_NAME in device[KEY_DEVICE_LOCATION] + if KEY_DEVICE_LOCATION in device + and KEY_DEVICE_LOCATION_NAME in device[KEY_DEVICE_LOCATION] ]