mirror of
https://github.com/home-assistant/core.git
synced 2026-07-07 14:56:25 +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>
11 lines
278 B
Python
11 lines
278 B
Python
"""Helpers used for Met Office integration."""
|
|
|
|
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
|