Closed tanmaster closed 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?
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 .
Merged!
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.