Skip to content

Commit

Permalink
get webos media player state
Browse files Browse the repository at this point in the history
  • Loading branch information
rale committed Jul 25, 2023
1 parent c312dcb commit f3c65c6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions homeassistant/components/webostv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,16 @@ def _update_states(self) -> None:
name=self._device_name,
)

if (
self._client.media_state is not None
and self._client.media_state.get("foregroundAppInfo") is not None
):
for entry in self._client.media_state.get("foregroundAppInfo"):
if entry.get("playState") == "playing":
self._attr_state = MediaPlayerState.PLAYING
elif entry.get("playState") == "paused":
self._attr_state = MediaPlayerState.PAUSED

if self._client.system_info is not None or self.state != MediaPlayerState.OFF:
maj_v = self._client.software_info.get("major_ver")
min_v = self._client.software_info.get("minor_ver")
Expand Down

0 comments on commit f3c65c6

Please sign in to comment.