mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Replace STATE_HOME with STATE_IDLE (#77385)
This commit is contained in:
parent
61d5ed1dcf
commit
fcba6def49
@ -30,7 +30,6 @@ from homeassistant.components.stream.const import FORMAT_CONTENT_TYPE, HLS_PROVI
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
ATTR_NAME,
|
||||
STATE_HOME,
|
||||
STATE_IDLE,
|
||||
STATE_ON,
|
||||
STATE_PAUSED,
|
||||
@ -161,13 +160,11 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
|
||||
|
||||
if (
|
||||
self.coordinator.data.app.name == "Power Saver"
|
||||
or self.coordinator.data.app.name == "Roku"
|
||||
or self.coordinator.data.app.screensaver
|
||||
):
|
||||
return STATE_IDLE
|
||||
|
||||
if self.coordinator.data.app.name == "Roku":
|
||||
return STATE_HOME
|
||||
|
||||
if self.coordinator.data.media:
|
||||
if self.coordinator.data.media.paused:
|
||||
return STATE_PAUSED
|
||||
|
@ -68,7 +68,6 @@ from homeassistant.const import (
|
||||
SERVICE_VOLUME_DOWN,
|
||||
SERVICE_VOLUME_MUTE,
|
||||
SERVICE_VOLUME_UP,
|
||||
STATE_HOME,
|
||||
STATE_IDLE,
|
||||
STATE_ON,
|
||||
STATE_PAUSED,
|
||||
@ -195,7 +194,7 @@ async def test_availability(
|
||||
mock_roku.update.side_effect = None
|
||||
async_fire_time_changed(hass, future)
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(MAIN_ENTITY_ID).state == STATE_HOME
|
||||
assert hass.states.get(MAIN_ENTITY_ID).state == STATE_IDLE
|
||||
|
||||
|
||||
async def test_supported_features(
|
||||
@ -253,7 +252,7 @@ async def test_attributes(
|
||||
"""Test attributes."""
|
||||
state = hass.states.get(MAIN_ENTITY_ID)
|
||||
assert state
|
||||
assert state.state == STATE_HOME
|
||||
assert state.state == STATE_IDLE
|
||||
|
||||
assert state.attributes.get(ATTR_MEDIA_CONTENT_TYPE) is None
|
||||
assert state.attributes.get(ATTR_APP_ID) is None
|
||||
|
Loading…
x
Reference in New Issue
Block a user