Philips TV - Add Screen state control (turn on/off TV Screen)

Philips TV can be used as speakers by turning tv on and keep screen off.

The Philips JS API supports this ability via the /screenstate/ end point. haphilipsjs package used by hass integration has built-in getScreenState and setScreenState functions that target this end point.

The ask is to add screen state control in Home Assistant Philips TV integration. The below code snippet adds 5 lines in remote.py async_send_command function to enable this via the remote.

if single_command == 'ScreenOff':
  await self._tv.setScreenState('Off')
elif single_command == 'ScreenOn':
  await self._tv.setScreenState('On')
else:
  await self._tv.sendKey(single_command)

Iā€™m not suggesting that it has to be implemented via the remote entity. The above snippet is to illustrate that all building blocks are available.

Will be in next release:

If I turn off the screen to listen the music it is reconized as TV to be turned off (sensor.media_player.philips_xxx = 0).

Is it possible to add correct status when TV is on or off?