mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +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.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_NAME,
|
ATTR_NAME,
|
||||||
STATE_HOME,
|
|
||||||
STATE_IDLE,
|
STATE_IDLE,
|
||||||
STATE_ON,
|
STATE_ON,
|
||||||
STATE_PAUSED,
|
STATE_PAUSED,
|
||||||
@ -161,13 +160,11 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
self.coordinator.data.app.name == "Power Saver"
|
self.coordinator.data.app.name == "Power Saver"
|
||||||
|
or self.coordinator.data.app.name == "Roku"
|
||||||
or self.coordinator.data.app.screensaver
|
or self.coordinator.data.app.screensaver
|
||||||
):
|
):
|
||||||
return STATE_IDLE
|
return STATE_IDLE
|
||||||
|
|
||||||
if self.coordinator.data.app.name == "Roku":
|
|
||||||
return STATE_HOME
|
|
||||||
|
|
||||||
if self.coordinator.data.media:
|
if self.coordinator.data.media:
|
||||||
if self.coordinator.data.media.paused:
|
if self.coordinator.data.media.paused:
|
||||||
return STATE_PAUSED
|
return STATE_PAUSED
|
||||||
|
@ -68,7 +68,6 @@ from homeassistant.const import (
|
|||||||
SERVICE_VOLUME_DOWN,
|
SERVICE_VOLUME_DOWN,
|
||||||
SERVICE_VOLUME_MUTE,
|
SERVICE_VOLUME_MUTE,
|
||||||
SERVICE_VOLUME_UP,
|
SERVICE_VOLUME_UP,
|
||||||
STATE_HOME,
|
|
||||||
STATE_IDLE,
|
STATE_IDLE,
|
||||||
STATE_ON,
|
STATE_ON,
|
||||||
STATE_PAUSED,
|
STATE_PAUSED,
|
||||||
@ -195,7 +194,7 @@ async def test_availability(
|
|||||||
mock_roku.update.side_effect = None
|
mock_roku.update.side_effect = None
|
||||||
async_fire_time_changed(hass, future)
|
async_fire_time_changed(hass, future)
|
||||||
await hass.async_block_till_done()
|
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(
|
async def test_supported_features(
|
||||||
@ -253,7 +252,7 @@ async def test_attributes(
|
|||||||
"""Test attributes."""
|
"""Test attributes."""
|
||||||
state = hass.states.get(MAIN_ENTITY_ID)
|
state = hass.states.get(MAIN_ENTITY_ID)
|
||||||
assert state
|
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_MEDIA_CONTENT_TYPE) is None
|
||||||
assert state.attributes.get(ATTR_APP_ID) is None
|
assert state.attributes.get(ATTR_APP_ID) is None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user