Fix roku play/pause support (#35991)

This commit is contained in:
Chris Talkington authored and GitHub committed 2020-05-23 11:06:48 +02:00
1 parent 919f3243de
commit 765bf760b4
2 files changed
+35

No files matched your search

@@ -7,6 +7,7 @@ from homeassistant.components.media_player.const import (
MEDIA_TYPE_APP,
MEDIA_TYPE_CHANNEL,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
SUPPORT_PLAY_MEDIA,
SUPPORT_PREVIOUS_TRACK,
@@ -29,6 +30,7 @@ SUPPORT_ROKU = (
| SUPPORT_VOLUME_STEP
| SUPPORT_VOLUME_MUTE
| SUPPORT_SELECT_SOURCE
| SUPPORT_PAUSE
| SUPPORT_PLAY
| SUPPORT_PLAY_MEDIA
| SUPPORT_TURN_ON
@@ -167,6 +169,14 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
"""Turn off the Roku."""
await self.coordinator.roku.remote("poweroff")
async def async_media_pause(self) -> None:
"""Send pause command."""
await self.coordinator.roku.remote("play")
async def async_media_play(self) -> None:
"""Send play command."""
await self.coordinator.roku.remote("play")
async def async_media_play_pause(self) -> None:
"""Send play/pause command."""
await self.coordinator.roku.remote("play")