mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
208013ab76
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
13 lines
314 B
Python
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
|