mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix play_pause command
This commit is contained in:
parent
3e01ce2a6c
commit
ac8a2d03d8
@ -137,9 +137,9 @@ class CastDevice(MediaPlayerDevice):
|
|||||||
""" Service to send the chromecast the command for play/pause. """
|
""" Service to send the chromecast the command for play/pause. """
|
||||||
media_state = self.state_attributes[ATTR_MEDIA_STATE]
|
media_state = self.state_attributes[ATTR_MEDIA_STATE]
|
||||||
if media_state == MEDIA_STATE_STOPPED or media_state == MEDIA_STATE_PAUSED:
|
if media_state == MEDIA_STATE_STOPPED or media_state == MEDIA_STATE_PAUSED:
|
||||||
self.media_pause()
|
self.cast.media_controller.play()
|
||||||
elif media_state == MEDIA_STATE_PLAYING:
|
elif media_state == MEDIA_STATE_PLAYING:
|
||||||
self.media_play()
|
self.cast.media_controller.pause()
|
||||||
|
|
||||||
def media_play(self):
|
def media_play(self):
|
||||||
""" Service to send the chromecast the command for play/pause. """
|
""" Service to send the chromecast the command for play/pause. """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user