1 """Support for HLK-SW16 relay switches."""
9 _LOGGER = logging.getLogger(__name__)
13 """Representation of a HLK-SW16 device.
15 Contains the common logic for HLK-SW16 entities.
18 _attr_should_poll =
False
20 def __init__(self, device_port, entry_id, client):
21 """Initialize the device."""
32 """Propagate changes through ha."""
33 _LOGGER.debug(
"Relay %s new state callback: %r", self.
unique_idunique_id, event)
39 """Return True if entity is available."""
44 """Update availability state."""
48 """Register update callback."""
49 self.
_client_client.register_status_callback(
56 f
"hlk_sw16_device_available_{self._entry_id}",
def async_added_to_hass(self)
def handle_event_callback(self, event)
def _availability_callback(self, availability)
def __init__(self, device_port, entry_id, client)
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)