1 """Support for Tellstick switches."""
3 from __future__
import annotations
12 ATTR_DISCOVER_DEVICES,
14 DEFAULT_SIGNAL_REPETITIONS,
16 from .entity
import TellstickDevice
22 add_entities: AddEntitiesCallback,
23 discovery_info: DiscoveryInfoType |
None =
None,
25 """Set up Tellstick switches."""
26 if discovery_info
is None or discovery_info[ATTR_DISCOVER_DEVICES]
is None:
30 signal_repetitions = discovery_info.get(
31 ATTR_DISCOVER_CONFIG, DEFAULT_SIGNAL_REPETITIONS
36 TellstickSwitch(hass.data[DATA_TELLSTICK][tellcore_id], signal_repetitions)
37 for tellcore_id
in discovery_info[ATTR_DISCOVER_DEVICES]
44 """Representation of a Tellstick switch."""
46 _attr_force_update =
True
49 """Turn the value from HA into something useful."""
52 """Turn the value received from tellcore into something useful."""
55 """Update the device entity state to match the arguments."""
59 """Let tellcore update the actual device to the requested state."""
def turn_on(self, **kwargs)
def turn_off(self, **kwargs)
def _send_device_command(self, requested_state, requested_data)
def _parse_tellcore_data(self, tellcore_data)
def _update_model(self, new_state, data)
def _parse_ha_data(self, kwargs)
None add_entities(AsusWrtRouter router, AddEntitiesCallback async_add_entities, set[str] tracked)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)