1 """Support for the for Danfoss Air HRV sswitches."""
3 from __future__
import annotations
8 from pydanfossair.commands
import ReadCommand, UpdateCommand
15 from .
import DOMAIN
as DANFOSS_AIR_DOMAIN
17 _LOGGER = logging.getLogger(__name__)
23 add_entities: AddEntitiesCallback,
24 discovery_info: DiscoveryInfoType |
None =
None,
26 """Set up the Danfoss Air HRV switch platform."""
27 data = hass.data[DANFOSS_AIR_DOMAIN]
33 UpdateCommand.boost_activate,
34 UpdateCommand.boost_deactivate,
39 UpdateCommand.bypass_activate,
40 UpdateCommand.bypass_deactivate,
43 "Danfoss Air Automatic Bypass",
44 ReadCommand.automatic_bypass,
45 UpdateCommand.bypass_activate,
46 UpdateCommand.bypass_deactivate,
51 DanfossAir(data, switch[0], switch[1], switch[2], switch[3])
52 for switch
in switches
57 """Representation of a Danfoss Air HRV Switch."""
59 def __init__(self, data, name, state_command, on_command, off_command):
60 """Initialize the switch."""
70 """Return the name of the switch."""
71 return self.
_name_name
75 """Return true if switch is on."""
79 """Turn the switch on."""
80 _LOGGER.debug(
"Turning on switch with command %s", self.
_on_command_on_command)
84 """Turn the switch off."""
85 _LOGGER.debug(
"Turning off switch with command %s", self.
_off_command_off_command)
89 """Update the switch's state."""
93 if self.
_state_state
is None:
94 _LOGGER.debug(
"Could not get data for %s", self.
_state_command_state_command)
None turn_off(self, **Any kwargs)
None turn_on(self, **Any kwargs)
def __init__(self, data, name, state_command, on_command, off_command)
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)
float|int|str|None get_value(Sensor sensor, str field)