Skip flume devices with location missing (#81441)

fixes #81438
pull/81488/head
J. Nick Koston 2022-11-03 08:51:08 +01:00 committed by Paulus Schoutsen
parent e25cf0b338
commit 632231912e
1 changed files with 2 additions and 1 deletions

View File

@ -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]
]