diff --git a/homeassistant/components/universal/media_player.py b/homeassistant/components/universal/media_player.py index c7cc0dd098d35..621e8c79433b1 100644 --- a/homeassistant/components/universal/media_player.py +++ b/homeassistant/components/universal/media_player.py @@ -46,6 +46,7 @@ MediaPlayerState, ) from homeassistant.const import ( + ATTR_ASSUMED_STATE, ATTR_ENTITY_ID, ATTR_ENTITY_PICTURE, ATTR_SUPPORTED_FEATURES, @@ -302,6 +303,11 @@ def name(self): """Return the name of universal player.""" return self._name + @property + def assumed_state(self) -> bool: + """Return True if unable to access real state of the entity.""" + return self._child_attr(ATTR_ASSUMED_STATE) + @property def state(self): """Return the current state of media player. diff --git a/tests/components/universal/test_media_player.py b/tests/components/universal/test_media_player.py index 8da38af5abe79..b800e3afd1246 100644 --- a/tests/components/universal/test_media_player.py +++ b/tests/components/universal/test_media_player.py @@ -476,6 +476,13 @@ async def test_state_children_only(hass, mock_states): await ump.async_update() assert ump.state == STATE_PLAYING + mock_states.mock_mp_1._state = STATE_ON + mock_states.mock_mp_1._attr_assumed_state = True + mock_states.mock_mp_1.async_schedule_update_ha_state() + await hass.async_block_till_done() + await ump.async_update() + assert ump.assumed_state is True + async def test_state_with_children_and_attrs( hass, config_children_and_attr, mock_states