Example #1
0
 def play_playlist(self, playlist_id, shuffle=False, repeat=False):
     response = control.client.post(
             control._url(f'/groups/{self.group_id}/playlists'),
             json={
                 "playlistId": int(playlist_id),
                 "playOnCompletion": True,
                 "playModes": {
                     "shuffle": shuffle,
                     "repeat": repeat,
                 },
             },
     )
     result = control._json(response)
     return result
Example #2
0
 def playlists(self):
     household_id = active_household_store.get_active_household()
     response = control.client.get(control._url(f'/households/{household_id}/playlists'))
     result = control._json(response)
     return result['playlists']
Example #3
0
 def playlist(self, playlist_id):
     household_id = active_household_store.get_active_household()
     response = control.client.post(control._url(f'/households/{household_id}/playlists/getPlaylist'), json={"playlistId": int(playlist_id)})
     result = control._json(response)
     return result
Example #4
0
 def favorites(self):
     household_id = active_household_store.get_active_household()
     response = control.client.get(control._url(f'/households/{household_id}/favorites'))
     result = control._json(response)
     return result['items']