1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-30 04:05:01 +01:00
Files
2026-04-30 21:14:48 +02:00

18 lines
501 B
Python

"""Utilities for Flume."""
from typing import Any
from pyflume import FlumeDeviceList
from .const import KEY_DEVICE_LOCATION, KEY_DEVICE_LOCATION_NAME
def get_valid_flume_devices(flume_devices: FlumeDeviceList) -> list[dict[str, Any]]:
"""Return a list of Flume devices that have a valid location."""
return [
device
for device in flume_devices.device_list
if KEY_DEVICE_LOCATION in device
and KEY_DEVICE_LOCATION_NAME in device[KEY_DEVICE_LOCATION]
]