msloth / lgtv.js

Control LG WebOS TV using node.js
MIT License
249 stars 119 forks source link

discover_ip returns 1st udp device #23

Closed blia closed 5 years ago

blia commented 5 years ago

https://github.com/msloth/lgtv.js/blob/4b6480711fb5f49c6efc4c1a44f0ec3d2898d561/index.js#L236 This code isn't working, because in JS -1 is true. So any device passes this condition.

This code works for me:

if (message.includes("Server: WebOS")) {
  ...
}
msloth commented 5 years ago

Ha! Thanks!