peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.19k stars 145 forks source link

Change detections #115

Closed ptorrent closed 5 years ago

ptorrent commented 6 years ago

Hello !

I would like to know if it is possible to detect the changes of state of a lamp without making a loop of requests?

Something like api.on('state change' ....

Is it possible ?

Thanks a lot for your reply !

peter-murray commented 6 years ago

Unfortunately that is not possible, the hue bridge has nothing to support that it is purely a request response over http. It has throttling and a maximum number of requests per second it can support, so if you do go that route of polling be careful you do not overload it.