Skip flume devices with location missing (#81441)

fixes #81438
This commit is contained in:
J. Nick Koston 2022-11-03 08:51:08 +01:00 committed by GitHub
parent 6bd8cf0072
commit adf35e5ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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