Switch play pause method in philips js (#85343)

fixes undefined
This commit is contained in:
Joakim Plate 2023-01-08 00:14:25 +01:00 committed by GitHub
parent dc000d2289
commit 8b6e54a01b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -177,7 +177,7 @@ class PhilipsTVMediaPlayer(
async def async_media_play_pause(self) -> None: async def async_media_play_pause(self) -> None:
"""Send pause command to media player.""" """Send pause command to media player."""
if self._tv.quirk_playpause_spacebar: if self._tv.quirk_playpause_spacebar:
await self._tv.sendUnicode(" ") await self._tv.sendKey("Confirm")
else: else:
await self._tv.sendKey("PlayPause") await self._tv.sendKey("PlayPause")
await self._async_update_soon() await self._async_update_soon()
@ -466,6 +466,8 @@ class PhilipsTVMediaPlayer(
self._attr_media_title = self._sources.get(self._tv.source_id) self._attr_media_title = self._sources.get(self._tv.source_id)
self._attr_media_channel = None self._attr_media_channel = None
self._attr_assumed_state = True
@callback @callback
def _handle_coordinator_update(self) -> None: def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator.""" """Handle updated data from the coordinator."""