-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't set colorMode #96
Comments
You can change color mode on lights in Huejay. Search |
@sqmk you may need to update the readme then:
As you can see it does not list colorMode as configurable. |
Yeah, I was about to reply again that the readme doesn't mention you can change colorMode. Let me confirm that you can actually change the value. I believe you should be able to. |
@sqmk i tried changing it directly and got an error, I dont recall the exact error. It does appear you can change the colorMode just indirectly and its a big confusing.. ike if i set and save hue AND saturation at the same time it will change colorMode to "hs", but IIRC it wasnt behaving correctly when i tried to change just hue alone (may have been a bug in my code though as i cant replicate it right now). Regardless that should probably be explained int he readme as the behavior isnt immediately obvious. |
Actually, looks like the light state action doesn't map colorMode on saving. This might be intentional. If you set hue/saturation, xy, or colorTemp, the bridge should automatically set the bulb itself to the correct colorMode without you having to explicitly set a value. For example, setting colorTemp on a light and saving should change colorMode to "ct". Same deal with xy or just hue/saturation. If it would be useful, I can consider adding colorMode as a configurable value and let the user explicitly set the value with the related color mode options. |
@sqmk yes that is the case. Though it can lead to weird behavior if some of those values are undefined. For example if hue and saturation are undefined but you attempt to set just one of them. Regardless probably worth adding to the readme considering that the behavior is a bit strange. |
I'll make a release tonight to allow explicit setting of colorMode. I don't see any reason not to expose changing the value, other than the user will need to understand that hue/sat, xy, and colorTemp correlate with a specific colorMode value. Thanks! I'll @ you and close this ticket when I cut the release. |
@sqmk I have local code that lets you set colorMode in a modified version of the repo. I can submit it as a pr but may not be a good idea. it causes exception if related values are undefined previously so you need to se those values or check them anyway. |
Feel free to submit as a PR. It will be on the user to know when / how to change color mode. I'm ok with an exception being thrown if required values aren't set for a given color mode. |
ISSUES CLOSED: sqmk#96
Excellent, I'll review and test tonight (8 or so hours from now), following with a new published version. Thank you! |
@sqmk no rush i managed to get my code fully functional without it. Just looking out for the lib and other users. BTW i forgot to update the readme to list it as cnfigurable now, dont forget to do that. |
@freemo Yup, I'll amend the readme, and will most likely have an example script for setting color mode and it's various properties in case someone down the road wants to see how to do the explicit thing. |
Come to find out, the bridge does not support setting color mode explicitly for lights or groups. Color mode attribute is changed on setting xy, color temp, or hue/saturation. I guess that's the reason why I didn't implement this. I attempted to modify colormode on both lights and groups, and the bridge did complain about the parameter not being available. Even Philip's docs mention that this value is only changed based on the previous light values set on it. I will be closing this ticket as there is nothing I can do for supporting changing this parameter. If you have other ideas surrounding color mode, feel free to open a new ticket and we can discuss features around it. |
All the lights in my house are the RGB type. I am trying to set all my lights to red but it doesnt work because they are currently in
ct
mode and there is no way to change that (the lights dont change at all). However if i use another app to change all my lights into hs mode and then execute my huejay command to turn them red it works just fine.Obviously without someway to change the colorMode in Huejay the library isnt particularly usable to me, am I missing something?
The text was updated successfully, but these errors were encountered: