Ape / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
711 stars 191 forks source link

New method to query TV status (ON/OFF) #71

Open RiRomain opened 6 years ago

RiRomain commented 6 years ago

This new method "is_tv_on()" report the status of the TV.

Until now, to know the status of the TV, a dummy key was sent and the exception/timeout was a sign of a TV being OFF. This is problematic on the latest TV (2017, 2018), as it wakes the TV up, if the TV was updating itself (or checking for update).

This was happening for example in Home-Assistant, the key command 'KEY' was send via websocket, randomly waking the TV up.

With the new method, the availability of the REST endpoint is checked (http://URL:PORT/api/v2/). It will still report the TV as being ON during update refresh, but won't turn it ON.

https://github.com/home-assistant/home-assistant/pull/11179

arsaboo commented 5 years ago

Any update on this?