1 """Support for Tellstick switches using Tellstick Net."""
12 from .const
import DOMAIN, TELLDUS_DISCOVERY_NEW
13 from .entity
import TelldusLiveEntity
18 config_entry: ConfigEntry,
19 async_add_entities: AddEntitiesCallback,
21 """Set up tellduslive sensors dynamically."""
23 async
def async_discover_switch(device_id):
24 """Discover and add a discovered sensor."""
25 client = hass.data[DOMAIN]
30 TELLDUS_DISCOVERY_NEW.format(switch.DOMAIN, DOMAIN),
31 async_discover_switch,
36 """Representation of a Tellstick switch."""
42 """Return true if switch is on."""
43 return self.
devicedevice.is_on
46 """Turn the switch on."""
51 """Turn the switch off."""
None turn_off(self, **Any kwargs)
None turn_on(self, **Any kwargs)
None schedule_update_ha_state(self, bool force_refresh=False)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)