peter-murray / node-hue-api

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

Feature Request: RGB for setGroupLightState #145

Closed atn closed 4 years ago

atn commented 4 years ago

Currently only setLightState has RGB.

peter-murray commented 4 years ago

The reason for that is that the rgb value has to be converted for each type of colour gamut for each light.

If you were to try to do this on a group, then you have to retrieve all the lights in the group, perform the conversion of rgb to hsl on each light, and then set that on each light, not via the grouping, so would creating a staggered effect as the lights in the group change as the bridge gets the request.

The hue API itself does not support rgb directly and the library provides it for individual lights as it can do this calculation and set the state with minimal noticeable issues. This would not apply in a group.

If you desire this type of thing, then a scene may be more appropriate, as you can set the rgb values in advance, save the scene and then recall it later using the group state with the scene id.

atn commented 4 years ago

Ah, okay. Thanks for the response.