markbergsma / pimatic-hue-zll

Pimatic integration with Philips Hue (ZLL)
GNU General Public License v2.0
7 stars 4 forks source link

Poll all Hue lights & groups in a single Hue API request #2

Closed markbergsma closed 8 years ago

markbergsma commented 8 years ago

With many lights (or groups) configured, there are a lot of getLightState requests being sent to the Hue bridge in the background, once every poll interval for each light. This is a lot of overhead, and sometimes results in connection resets as well.

If the majority of Hue lights in the system are configured and being polled individually anyway, it would be more efficient to request the state of all Hue lights from the API at once. Unfortunately, it appears that peter-murray/node-hue-api currently doesn't offer a way to do that. The lights() method filters out the 'state' object that is being returned by the Hue API.