forked from home-assistant/core
Avoid sending Standby when already off (#56306)
This commit is contained in:
@@ -213,9 +213,12 @@ class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
|||||||
|
|
||||||
async def async_turn_off(self):
|
async def async_turn_off(self):
|
||||||
"""Turn off the device."""
|
"""Turn off the device."""
|
||||||
await self._tv.sendKey("Standby")
|
if self._state == STATE_ON:
|
||||||
self._state = STATE_OFF
|
await self._tv.sendKey("Standby")
|
||||||
await self._async_update_soon()
|
self._state = STATE_OFF
|
||||||
|
await self._async_update_soon()
|
||||||
|
else:
|
||||||
|
_LOGGER.debug("Ignoring turn off when already in expected state")
|
||||||
|
|
||||||
async def async_volume_up(self):
|
async def async_volume_up(self):
|
||||||
"""Send volume up command."""
|
"""Send volume up command."""
|
||||||
|
Reference in New Issue
Block a user