Files
core/homeassistant/components/flume/util.py
T
epenetGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>frenck
d766aae436 Remove import annotations from components (#169536)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
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]
]