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

Update of README to represent implementation and Added setLightstate for Groups of Lights #3

Closed SBejga closed 11 years ago

SBejga commented 11 years ago

I just found a small inconsistence in README. The input parameters for setting lightState with hsl(hue, saturation, brightPercent) is not described like implemented.

hue is implemented as value between 0 and 359 (degrees) and saturation is now also implemented as value between 0 and 100 (percent) like brightPercent.

Re-calculation to expected values by hue API is done by _getHSLState in lightstate.js.

Furthermore I added the function to set lightStates for a group of lights via one request using the Group API (http://developers.meethue.com/2_groupsapi.html). Added an additionally parameter to setLightState if it is a lightState change for a group. Then it will use the different REST endpoint with same request payload. Otherwise (when no group) it will use the standard endpoint for a single change of one lightState.