mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
parent
1d2e930900
commit
87c0fd98c7
@ -29,7 +29,7 @@ DOMAIN = 'itunes'
|
||||
|
||||
SUPPORT_ITUNES = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \
|
||||
SUPPORT_PREVIOUS_TRACK | SUPPORT_NEXT_TRACK | SUPPORT_SEEK | \
|
||||
SUPPORT_PLAY_MEDIA | SUPPORT_PLAY
|
||||
SUPPORT_PLAY_MEDIA | SUPPORT_PLAY | SUPPORT_TURN_OFF
|
||||
|
||||
SUPPORT_AIRPLAY = SUPPORT_VOLUME_SET | SUPPORT_TURN_ON | SUPPORT_TURN_OFF
|
||||
|
||||
@ -115,6 +115,10 @@ class Itunes(object):
|
||||
"""Skip back and returns the current state."""
|
||||
return self._command('previous')
|
||||
|
||||
def stop(self):
|
||||
"""Stop playback and return the current state."""
|
||||
return self._command('stop')
|
||||
|
||||
def play_playlist(self, playlist_id_or_name):
|
||||
"""Set a playlist to be current and returns the current state."""
|
||||
response = self._request('GET', '/playlists')
|
||||
@ -346,6 +350,11 @@ class ItunesDevice(MediaPlayerDevice):
|
||||
response = self.client.play_playlist(media_id)
|
||||
self.update_state(response)
|
||||
|
||||
def turn_off(self):
|
||||
"""Turn the media player off."""
|
||||
response = self.client.stop()
|
||||
self.update_state(response)
|
||||
|
||||
|
||||
class AirPlayDevice(MediaPlayerDevice):
|
||||
"""Representation an AirPlay device via an iTunes API instance."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user