Skip to content

Commit

Permalink
Avoid sending Standby when already off (#56306)
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus authored and balloob committed Sep 18, 2021
1 parent 9c4d6af commit 8c936b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions homeassistant/components/philips_js/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,12 @@ async def async_turn_on(self):

async def async_turn_off(self):
"""Turn off the device."""
await self._tv.sendKey("Standby")
self._state = STATE_OFF
await self._async_update_soon()
if self._state == STATE_ON:
await self._tv.sendKey("Standby")
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):
"""Send volume up command."""
Expand Down

0 comments on commit 8c936b3

Please sign in to comment.