AlexGustafsson / homebridge-wol

A Wake on Lan plugin for Homebridge
MIT License
301 stars 30 forks source link

fix pinger not working correctly when using pingCommand #77

Closed tanmaster closed 5 years ago

tanmaster commented 5 years ago

Boolean(error) is true when the command exits with a nonzero state. What is needed is false though. Also this.pinging needs to be set to false, else the ping function is only executed once.

AlexGustafsson commented 5 years ago

Looks good! Have you been able to test it in action?

Also, have you been able to correlate any open issue that should be able to be closed by merging this fix?

tanmaster commented 5 years ago

Yea I made a simple test by setting the pingCommand to "ping 192.168.1.xxx -c 4" for my PC which I usually control via homebridge-wol. The current version of homebridge-wol showed the device online when the it was off and offline when it was on. Also the state would never get updated because the ping function would always immediately return. With the fix the device's state and behaviour was as expected. It looks like this would resolve Issue #76 .

AlexGustafsson commented 5 years ago

Merged!