AlexGustafsson / homebridge-wol

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

Complete refactor #14

Closed AlexGustafsson closed 7 years ago

AlexGustafsson commented 7 years ago

Fixes #11, #10 as well as some other issues related to sudo rights permissions have has been closed due to workarounds (sudo homebridge).

AlexGustafsson commented 7 years ago

It seems as if the move to ping from net-ping has introduced a problem where the status of the accessories can "flicker" - the pinger returns false negatives when pinging was unsuccessful. The probable cause is that ping simply pings once per call potentially making it a bit less accurate than net-ping.

How should this be handled?

My idea: Store the last n (i.e. 5) pings in the Pinger class and only callback a change if all of the stored pings are the same value, otherwise return the latest value where all values were the same. If there are less than n pings (aka, just started pinging) the current value should be returned instead.

AlexGustafsson commented 7 years ago

@blubber Do you have the time to try the new version of homebridge-wol? I'd like to ensure that it's stable and ready for merging.