1 """Base entity Ambient Weather Station Service."""
3 from __future__
import annotations
5 from aioambient.util
import get_public_device_id
12 from .
import AmbientStation
13 from .const
import ATTR_LAST_DATA, DOMAIN, TYPE_SOLARRADIATION, TYPE_SOLARRADIATION_LX
17 """Define a base Ambient PWS entity."""
19 _attr_has_entity_name =
True
20 _attr_should_poll =
False
24 ambient: AmbientStation,
27 description: EntityDescription,
29 """Initialize the entity."""
32 public_device_id = get_public_device_id(mac_address)
35 f
"https://ambientweather.net/dashboard/{public_device_id}"
37 identifiers={(DOMAIN, mac_address)},
38 manufacturer=
"Ambient Weather",
39 name=station_name.capitalize(),
48 """Update the state."""
51 available_key = TYPE_SOLARRADIATION
if key == TYPE_SOLARRADIATION_LX
else key
57 """Register callbacks."""
61 f
"ambient_station_data_update_{self._mac_address}",
70 """Update the entity from the latest data."""
71 raise NotImplementedError
None async_added_to_hass(self)
None update_from_latest_data(self)
None __init__(self, AmbientStation ambient, str mac_address, str station_name, EntityDescription description)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)