PhilipsHue / PhilipsHueSDK-Java-MultiPlatform-Android

The Software Development Kit for Philips Hue Java Mulfi-Platform and Android (beta)
273 stars 214 forks source link

Valid saturation and brightness values should be [0-255] #15

Closed J-Swift closed 9 years ago

J-Swift commented 9 years ago

Light updates fail when using a value of 255 for either the saturation or brightness values. It says it accepts a max of 254, which seems a bit odd. The hue value allows [0-65535], which is what I would expect.

SteveyO commented 9 years ago

Yes, maybe a little unclear this. The Lights API allows setting a value of 255 but the value gets saved as 254 in the lamps. Not sure why this is the case, maybe related to ZigBee. To avoid potentially confusing developers (i.e. in case they set a brightness of 255 and then see that the cache value is 254) we decided to limit the values to 254. Really, the valid values should be 1-254. Not much I can do here, apart from clarify this in the Lights API page.

J-Swift commented 9 years ago

That's unfortunate, but understood. Thanks for clarifying why this is the case.