1 """Entity classes for the AEMET OpenData integration."""
3 from __future__
import annotations
7 from aemet_opendata.helpers
import dict_nested_value
13 from .const
import ATTRIBUTION, DOMAIN
14 from .coordinator
import WeatherUpdateCoordinator
18 """Define an AEMET entity."""
20 _attr_attribution = ATTRIBUTION
21 _attr_has_entity_name =
True
25 coordinator: WeatherUpdateCoordinator,
29 """Initialize the entity."""
33 entry_type=DeviceEntryType.SERVICE,
34 identifiers={(DOMAIN, unique_id)},
40 """Return AEMET entity forecast by mode."""
41 return self.coordinator.data[
"forecast"][forecast_mode]
44 """Return AEMET entity value by keys."""
45 return dict_nested_value(self.coordinator.data[
"lib"], keys)
list[Forecast] get_aemet_forecast(self, str forecast_mode)
Any get_aemet_value(self, list[str] keys)
None __init__(self, WeatherUpdateCoordinator coordinator, str name, str unique_id)