mirror of
https://github.com/home-assistant/core.git
synced 2026-05-30 04:05:01 +01:00
d766aae436
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
18 lines
501 B
Python
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]
|
|
]
|