rudders / homebridge-http

HTTP Plugin for Homebridge
Apache License 2.0
178 stars 110 forks source link

Ability to set poll interval #76

Closed moog-man closed 3 years ago

moog-man commented 6 years ago

I think 300ms for polling is putting a lot of strain onto the network and the target device. I propose to either have a property which allows to set the poll interval, or alternatively allow switchHandling to have a time instead of "realtime". The old behavior could be maintained when "realtime" is entered. Any other value from "300" - "60000" would then set the respective poll frequency.

NovaGL commented 6 years ago

Not sure if this still works as I haven't used this in awhile. But the polling time should be coming from "polling-to-event" can you try changing it in that module and see if it makes a difference

moog-man commented 6 years ago

I will try!

Matthias Schorer Akilindastrasse 2a 82166 Gräfelfing

m: +49 170 542 4819 e: mschorer@me.com

sent from my iPhone 7

Am 31.10.2017 um 03:50 schrieb NovaGL notifications@github.com:

Not sure if this still works as I haven't used this in awhile. But the polling time should be coming from "polling-to-event" can you try changing it in that module and see if it makes a difference

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

marcetcheverry commented 6 years ago

Agreed, polling at 300 milliseconds is way too intensive

tamasharasztosi commented 6 years ago

In your node_modules folder (cd /usr/lib/node_modules/homebridge-http/) sudo nano index.js and change interval time at the line 59. }, { longpolling: true, interval: 300, longpollEventName: "statuspoll" });

300 (ms) -» 5000 (ms) worked for me