1 """Base class for all eQ-3 entities."""
13 from .
import Eq3ConfigEntry
17 SIGNAL_THERMOSTAT_CONNECTED,
18 SIGNAL_THERMOSTAT_DISCONNECTED,
23 """Base class for all eQ-3 entities."""
25 _attr_has_entity_name =
True
29 entry: Eq3ConfigEntry,
30 unique_id_key: str |
None =
None,
32 """Initialize the eq3 entity."""
38 manufacturer=MANUFACTURER,
40 connections={(CONNECTION_BLUETOOTH, self.
_eq3_config_eq3_config.mac_address)},
42 suffix = f
"_{unique_id_key}" if unique_id_key
else ""
43 self.
_attr_unique_id_attr_unique_id = f
"{format_mac(self._eq3_config.mac_address)}{suffix}"
46 """Run when entity about to be added to hass."""
53 f
"{SIGNAL_THERMOSTAT_DISCONNECTED}_{self._eq3_config.mac_address}",
60 f
"{SIGNAL_THERMOSTAT_CONNECTED}_{self._eq3_config.mac_address}",
66 """Run when entity will be removed from hass."""
71 """Handle updated data from the thermostat."""
77 """Handle disconnection from the thermostat."""
84 """Handle connection to the thermostat."""
91 """Whether the entity is available."""
None async_added_to_hass(self)
None _async_on_updated(self)
None _async_on_connected(self)
None __init__(self, Eq3ConfigEntry entry, str|None unique_id_key=None)
None async_will_remove_from_hass(self)
None _async_on_disconnected(self)
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)