Add stop command to google cast component (#2269)
* Add stop command to google cast component * Add SUPPORT_STOP capabilities to google cast component
This commit is contained in:
parent
71eb09ee5e
commit
868c08e34b
1 changed files with 6 additions and 2 deletions
|
@ -11,7 +11,7 @@ from homeassistant.components.media_player import (
|
|||
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,
|
||||
SUPPORT_PAUSE, SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK,
|
||||
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||
MediaPlayerDevice)
|
||||
SUPPORT_STOP, MediaPlayerDevice)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,
|
||||
STATE_UNKNOWN)
|
||||
|
@ -21,7 +21,7 @@ CONF_IGNORE_CEC = 'ignore_cec'
|
|||
CAST_SPLASH = 'https://home-assistant.io/images/cast/splash.png'
|
||||
SUPPORT_CAST = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \
|
||||
SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \
|
||||
SUPPORT_NEXT_TRACK | SUPPORT_PLAY_MEDIA
|
||||
SUPPORT_NEXT_TRACK | SUPPORT_PLAY_MEDIA | SUPPORT_STOP
|
||||
KNOWN_HOSTS = []
|
||||
|
||||
DEFAULT_PORT = 8009
|
||||
|
@ -241,6 +241,10 @@ class CastDevice(MediaPlayerDevice):
|
|||
"""Send pause command."""
|
||||
self.cast.media_controller.pause()
|
||||
|
||||
def media_stop(self):
|
||||
"""Send stop command."""
|
||||
self.cast.media_controller.stop()
|
||||
|
||||
def media_previous_track(self):
|
||||
"""Send previous track command."""
|
||||
self.cast.media_controller.rewind()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue