Exemplo n.º 1
0
 def play_music(self, uri):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "play_media",
                               entity_id=media_player.entity_id,
                               media_content_id=uri,
                               media_content_type="music")
Exemplo n.º 2
0
 def set_temperature(self, temperature, hvac_mode):
     for thermostat in self._thermostats:
         hassutil.call_service("climate",
                               "set_temperature",
                               entity_id=thermostat.entity_id,
                               temperature=temperature,
                               hvac_mode=hvac_mode)
         hassutil.call_service("climate",
                               "set_hvac_mode",
                               entity_id=thermostat.entity_id,
                               hvac_mode=hvac_mode)
Exemplo n.º 3
0
 def change_input(self, input_name):
     for media_player in self._media_players:
         inputs = entity_map.get(media_player.entity_id).get("inputs")
         if input_name in inputs:
             hassutil.call_service("media_player",
                                   "select_source",
                                   entity_id=media_player.entity_id,
                                   source=inputs.get(input_name))
         else:
             logger.error("Unable to set {} input on {}".format(
                 media_player, input_name))
Exemplo n.º 4
0
 def locate(self):
     for vacuum in self._vacuums:
         hassutil.call_service("vacuum",
                               "locate",
                               entity_id=vacuum.entity_id)
Exemplo n.º 5
0
 def return_home(self):
     for vacuum in self._vacuums:
         hassutil.call_service("vacuum",
                               "return_to_base",
                               entity_id=vacuum.entity_id)
Exemplo n.º 6
0
 def stop(self):
     for vacuum in self._vacuums:
         hassutil.call_service("vacuum", "stop", entity_id=vacuum.entity_id)
Exemplo n.º 7
0
 def pause(self):
     for vacuum in self._vacuums:
         hassutil.call_service("vacuum",
                               "pause",
                               entity_id=vacuum.entity_id)
Exemplo n.º 8
0
 def set_volume(self, volume):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "volume_set",
                               entity_id=media_player.entity_id,
                               volume_level=volume)
Exemplo n.º 9
0
 def unmute(self):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "volume_mute",
                               entity_id=media_player.entity_id,
                               is_volume_muted=False)
Exemplo n.º 10
0
 def toggle_pause(self):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "media_play_pause",
                               entity_id=media_player.entity_id)
Exemplo n.º 11
0
 def stop(self):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "media_stop",
                               entity_id=media_player.entity_id)
Exemplo n.º 12
0
 def clear_playlist(self):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "clear_playlist",
                               entity_id=media_player.entity_id)
Exemplo n.º 13
0
 def volume_down(self):
     for media_player in self._media_players:
         hassutil.call_service("media_player",
                               "volume_down",
                               entity_id=media_player.entity_id)
Exemplo n.º 14
0
 def run(self):
     for script in self._scripts:
         hassutil.call_service("script", script)