normen / homebridge-bravia

Homebridge plugin for Sony Bravia TVs (AndroidTV based ones and possibly others)
139 stars 26 forks source link

Turning TV on - expected behaviour? #26

Closed SteveCohen closed 6 years ago

SteveCohen commented 6 years ago

Hi @normen, awesome plugin. Thanks for your work on this. I've installed, mostly to torn the tv on & off. The plugin detects powerstatus properly, and can turn the TV off, but does not turn it on. Is this expected behaviour? Am I missing something? (I have a non-android Bravia; KDL-32W700b)

  1. I've looked over the code and couldn't see a wakeup-on-lan option. Is this needed? Have you considered a wol function to wake tvs, already?
  2. Line 570 of index.js sets the final parameter of makeHttpRequest (canTurnTvOn) to false when trying to set the state to true... If I'm interpreting this correctly, this means trying to give the "turn on" command can't turn the TV on. Is this right/expected behaviour?

Happy to do the dev & testing and submit a PR, but want to check I'm understanding, first.

normen commented 6 years ago

1) The original plugin had some code in terms of WOL but I largely removed it because it was convoluted and I didn't need it to turn on my TV. Maybe check if you can set your TV to some kind of "sleep" mode instead of turning off completely. 2) No, that false is for the callback, the "true" in the string above is what counts.

If you want to implement WOL you can send me a PR, maybe take a look at the code of the original plugin (link on the readme page).