Open Shoshkin opened 2 years ago
@nitaybz Could you please merge this? :)
Would fix issues for me most likely. E.g. I get two disconnect messages in the logs from the same device. No "connect" message im between!
[16/02/2023, 05:27:37] [homebridge-network-presence] [Pixel 5] - disconnected from the network (mac: f8:1a:xx:xx:xx:xx | ip:192.168.178.61 | hostname:Pixel-5.fritz.box)
[16/02/2023, 07:22:23] [homebridge-network-presence] [Pixel 5] - disconnected from the network (mac: f8:1a:xx:xx:xx:xx | ip:192.168.178.61 | hostname:Pixel-5.fritz.box)
Assuming the following scenario -
threshold
minutes. A is still on this.isDetected = 1.The solution is to make sure that only isDetected=0 creates a timer and that only isDetecetd=1 cancels the timer