Skip to content

Commit

Permalink
Fix WebOS TV media player status when OFF after IDLE (#121251)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecode authored Jul 4, 2024
1 parent 276f6c7 commit b14f229
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homeassistant/components/webostv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ def _update_states(self) -> None:

self._attr_assumed_state = True
if (
self._client.media_state is not None
self._client.is_on
and self._client.media_state is not None
and self._client.media_state.get("foregroundAppInfo") is not None
):
self._attr_assumed_state = False
Expand Down
4 changes: 4 additions & 0 deletions tests/components/webostv/test_media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,3 +849,7 @@ async def test_update_media_state(
monkeypatch.setattr(client, "media_state", data)
await client.mock_state_update()
assert hass.states.get(ENTITY_ID).state == MediaPlayerState.IDLE

monkeypatch.setattr(client, "is_on", False)
await client.mock_state_update()
assert hass.states.get(ENTITY_ID).state == STATE_OFF

0 comments on commit b14f229

Please sign in to comment.