-
Notifications
You must be signed in to change notification settings - Fork 23
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
Keep current color when changing brightness #18
Comments
Such a feature would be nice indeed. Ideally we would have to read the current color from the bulb but that part is still tricky (see #17). But we could be able to do that right now by storing the current color in MagicBlueLib.
|
It appears from this article that the bulb actually has two sets of LEDs: one set for colors, one set for warm light. (As seen on this image.) I think that you cannot use both sets of LEDs at the same time (at least via Bluetooth), possibly due to prevention of overheating or drawing too much current. The name 'brightness' is perhaps misleading since RGB and warm light are actually two different (physical) things for this bulb. The brightness of RGB is controlled by setting a darker RGB color. The brightness of warm light is controlled by setting a lower intensity for warm light. Maybe the API should avoid the word brightness and instead use warm_light_intensity in method turn_on(). The method can also be extended by adding an additional parameter for RGB. Or, the API can be simplified by not accepting any further paramters, forcing the user to call it turn_on() and set_warm_light()/set_color() directly. (The last has my preference.) By looking at turn_on(), actually, I see that it calls set_color() with a RGB color. Maybe the firmware is smart enough to use the warm light LEDS if all parts of the RGB color are the same. |
The color is set to
white
whenbulb.turn_on(BRIGHTNESS)
is called. And the brightness is set to100%
when callingbulb.set_color([R, G, B])
.I haven't looked into the MagicBlue's BLE characteristic, so I'm not sure if this is easy to accomplish.
The text was updated successfully, but these errors were encountered: