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 Paulus Schoutsen
parent cf06f3b81d
commit 00e563f1b8

View File

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