1 """Support for SUPLA switch."""
3 from __future__
import annotations
6 from pprint
import pformat
14 from .
import DOMAIN, SUPLA_COORDINATORS, SUPLA_SERVERS
15 from .entity
import SuplaEntity
17 _LOGGER = logging.getLogger(__name__)
23 async_add_entities: AddEntitiesCallback,
24 discovery_info: DiscoveryInfoType |
None =
None,
26 """Set up the SUPLA switches."""
27 if discovery_info
is None:
30 _LOGGER.debug(
"Discovery: %s", pformat(discovery_info))
33 for device
in discovery_info.values():
34 server_name = device[
"server_name"]
39 hass.data[DOMAIN][SUPLA_SERVERS][server_name],
40 hass.data[DOMAIN][SUPLA_COORDINATORS][server_name],
48 """Representation of a SUPLA Switch."""
51 """Turn on the switch."""
55 """Turn off the switch."""
60 """Return true if switch is on."""
def async_action(self, action, **add_pars)
None async_turn_on(self, **Any kwargs)
None async_turn_off(self, **Any kwargs)
web.Response get(self, web.Request request, str config_key)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)