def add_light(self, light): if light in name_map: self._lights.append(hassutil.Entity(name_map[light])) else: logger.error( "Unable to add unknown light to LightAction: {}".format(light)) return self
def add_lock(self, lock): if lock in name_map: self._locks.append(hassutil.Entity(name_map[lock])) else: logger.error( "Unable to add unknown lock to DoorLockAction: {}".format( lock)) return self
def add_thermostat(self, thermostat): if thermostat in name_map: self._thermostats.append(hassutil.Entity(name_map[thermostat])) else: logger.error( "Unable to add unknown thermostat to ThermostatAction: {}". format(thermostat)) return self
def add_vacuum(self, vacuum): if vacuum in name_map: self._vacuums.append(hassutil.Entity(name_map[vacuum])) else: logger.error( "Unable to add unknown light to VacuumAction: {}".format( vacuum)) return self
def add_assistant(self, assistant): if assistant in name_map: self._assistants.append(hassutil.Entity(name_map[assistant])) else: logger.error( "Unable to add unknown assistant to TTSAction: {}".format( assistant)) return self
def add_media_player(self, media_player): if media_player in name_map: self._media_players.append(hassutil.Entity(name_map[media_player])) else: logger.error( "Unable to add unknown light to MediaPlayerAction: {}".format( media_player)) return self
def add_switch(self, switch): if switch in name_map: self._switches.append(hassutil.Entity(name_map[switch])) else: logger.error( "Unable to add unknown switch to switchAction: {}".format( switch)) return self
def on_single_click(event): logger.info("Basement Button single clicked") hassutil.toggle(hassutil.Entity(name_map["workout_mode"]))
def on_long_press(event): logger.info("Master Bedroom Button long pressed") hassutil.toggle(hassutil.Entity(name_map["sleep_mode"]))