1 """Base class for Airtouch5 entities."""
3 from airtouch5py.airtouch5_client
import Airtouch5ConnectionStateChange
4 from airtouch5py.airtouch5_simple_client
import Airtouch5SimpleClient
11 """Base class for Airtouch5 entities."""
13 _attr_should_poll =
False
14 _attr_has_entity_name =
True
16 def __init__(self, client: Airtouch5SimpleClient) ->
None:
17 """Initialise the Entity."""
23 self, state: Airtouch5ConnectionStateChange
25 self.
_attr_available_attr_available = state
is Airtouch5ConnectionStateChange.CONNECTED
29 """Add data updated listener after this object has been initialized."""
30 self.
_client_client.connection_state_callbacks.append(
35 """Remove data updated listener when entity is removed from homeassistant."""
36 self.
_client_client.connection_state_callbacks.remove(
None _receive_connection_callback(self, Airtouch5ConnectionStateChange state)
None async_will_remove_from_hass(self)
None async_added_to_hass(self)
None __init__(self, Airtouch5SimpleClient client)
None async_write_ha_state(self)