studioimaginaire / phue

A Python library for the Philips Hue system
Other
1.52k stars 267 forks source link

RGB error #177

Open Jan20202020 opened 3 years ago

Jan20202020 commented 3 years ago

When i try to set an rgb value for a lamp i get this error:

ERROR, parameter, rgb, not avalible for light 2

My code: hue.set_light(2, {'rgb': (255, 102, 0)})

natcl commented 3 years ago

Hue lights don’t support direct rgb control, you can only use hue or xy mode. Some libraries can help you do the conversion: https://pypi.org/project/rgbxy/

-- lecaude.com studioimaginaire.com

On Nov 2, 2020 at 6:40:20 AM, Jan20202020 notifications@github.com wrote:

When i try to set an rgb value for a lamp i get this error:

ERROR, parameter, rgb, not avalible for light 2

My code: hue.set_light(2, {'rgb': (255, 102, 0)})

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/studioimaginaire/phue/issues/177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAS55APIRKVK6Z3PHIPZLDSN2LCJANCNFSM4THLRXHQ .

Jan20202020 commented 3 years ago

And what about hex colors? Are they working?

natcl commented 3 years ago

No, same principle, the hue API only supports XY and Hue/saturation modes, you’ll need to find a way to convert rgb to the XY colorspace.

On Nov 2, 2020 at 8:56:53 AM, Jan20202020 notifications@github.com wrote:

And what about hex colors? Are they working?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/studioimaginaire/phue/issues/177#issuecomment-720487244, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAS55E3LMC2L7TOOWNZ3FDSN23CLANCNFSM4THLRXHQ .