core/homeassistant/components/metoffice/data.py

20 lines
462 B
Python
Raw Normal View History

"""Common Met Office Data class used by both sensor and entity."""
2023-10-10 19:34:49 +00:00
from __future__ import annotations
from dataclasses import dataclass
2023-10-10 19:34:49 +00:00
import sys
2023-10-10 19:34:49 +00:00
if sys.version_info < (3, 12):
from datapoint.Forecast import Forecast
from datapoint.Site import Site
from datapoint.Timestep import Timestep
@dataclass
class MetOfficeData:
"""Data structure for MetOffice weather and forecast."""
now: Forecast
forecast: list[Timestep]
site: Site