1 """The Tomorrow.io integration."""
3 from __future__
import annotations
5 from pytomorrowio.const
import CURRENT
12 from .const
import ATTRIBUTION, DOMAIN, INTEGRATION_NAME
13 from .coordinator
import TomorrowioDataUpdateCoordinator
17 """Base Tomorrow.io Entity."""
19 _attr_attribution = ATTRIBUTION
20 _attr_has_entity_name =
True
24 config_entry: ConfigEntry,
25 coordinator: TomorrowioDataUpdateCoordinator,
28 """Initialize Tomorrow.io Entity."""
33 identifiers={(DOMAIN, self.
_config_entry_config_entry.data[CONF_API_KEY])},
34 manufacturer=INTEGRATION_NAME,
35 sw_version=f
"v{self.api_version}",
36 entry_type=DeviceEntryType.SERVICE,
40 """Get property from current conditions.
45 return self.coordinator.data[entry_id].
get(CURRENT, {}).
get(property_name)
None __init__(self, ConfigEntry config_entry, TomorrowioDataUpdateCoordinator coordinator, int api_version)
int|str|float|None _get_current_property(self, str property_name)
web.Response get(self, web.Request request, str config_key)