1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00
Files
core/homeassistant/components/metoffice/helpers.py
T

13 lines
314 B
Python

"""Helpers used for Met Office integration."""
from __future__ import annotations
from typing import Any
def get_attribute(data: dict[str, Any] | None, attr_name: str) -> Any | None:
"""Get an attribute from weather data."""
if data:
return data.get(attr_name, {}).get("value")
return None