mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Replace MediaPlayerState.STANDBY with MediaPlayerState.OFF in roku (#148137)
This commit is contained in:
parent
783102f2f6
commit
3f752e13ff
@ -142,7 +142,7 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
|
||||
def state(self) -> MediaPlayerState | None:
|
||||
"""Return the state of the device."""
|
||||
if self.coordinator.data.state.standby:
|
||||
return MediaPlayerState.STANDBY
|
||||
return MediaPlayerState.OFF
|
||||
|
||||
if self.coordinator.data.app is None:
|
||||
return None
|
||||
@ -308,21 +308,21 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
|
||||
@roku_exception_handler()
|
||||
async def async_media_pause(self) -> None:
|
||||
"""Send pause command."""
|
||||
if self.state not in {MediaPlayerState.STANDBY, MediaPlayerState.PAUSED}:
|
||||
if self.state not in {MediaPlayerState.OFF, MediaPlayerState.PAUSED}:
|
||||
await self.coordinator.roku.remote("play")
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
@roku_exception_handler()
|
||||
async def async_media_play(self) -> None:
|
||||
"""Send play command."""
|
||||
if self.state not in {MediaPlayerState.STANDBY, MediaPlayerState.PLAYING}:
|
||||
if self.state not in {MediaPlayerState.OFF, MediaPlayerState.PLAYING}:
|
||||
await self.coordinator.roku.remote("play")
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
@roku_exception_handler()
|
||||
async def async_media_play_pause(self) -> None:
|
||||
"""Send play/pause command."""
|
||||
if self.state != MediaPlayerState.STANDBY:
|
||||
if self.state != MediaPlayerState.OFF:
|
||||
await self.coordinator.roku.remote("play")
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
|
@ -52,10 +52,10 @@ from homeassistant.const import (
|
||||
SERVICE_VOLUME_MUTE,
|
||||
SERVICE_VOLUME_UP,
|
||||
STATE_IDLE,
|
||||
STATE_OFF,
|
||||
STATE_ON,
|
||||
STATE_PAUSED,
|
||||
STATE_PLAYING,
|
||||
STATE_STANDBY,
|
||||
STATE_UNAVAILABLE,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -112,7 +112,7 @@ async def test_idle_setup(
|
||||
"""Test setup with idle device."""
|
||||
state = hass.states.get(MAIN_ENTITY_ID)
|
||||
assert state
|
||||
assert state.state == STATE_STANDBY
|
||||
assert state.state == STATE_OFF
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mock_device", ["roku/rokutv-7820x.json"], indirect=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user