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 and frenck committed Jul 5, 2024
1 parent eda4508 commit 651439e
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 @@ -832,3 +832,7 @@ async def test_update_media_state(hass: HomeAssistant, client, monkeypatch) -> N
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 651439e

Please sign in to comment.