-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(underglow): Add support for configurable min/max brightness #944
feat(underglow): Add support for configurable min/max brightness #944
Conversation
2850ea5
to
6fb8b01
Compare
I just noticed #669... There are a few differences however: #669 treats #669 treats
Finally, since #669 applies brightness scaling in a central place, it's almost impossible to "forget" to do it. But the different approach used by this PR requires scaling/clamping to be applied in a few different places, so the risk of introducing mistakes during future code changes is comparatively higher (although they would be easy to fix). |
6fb8b01
to
22e67d9
Compare
I think I favor the solution in #669 on this one. Having it be a percentage of the available brightness range ensures that if I tweak the minx/max a tad to adjust, I still always have the same number of steps available.
Tad torn here. I can see the value of not having the minimum value for the breathing effect limited here, but also I can see wanting the max for the breathing effect clamped by this settings. @Nicell Thoughts? |
22e67d9
to
7adfea7
Compare
Fixed in the latest push.
Actually, the breathing effect does scale its output according to the max brightness, it simply doesn't use the min brightness at all to be able to go down to brightness 0 (I thought it was more aesthetically pleasing this way, but this could be changed easily, especially now with the scaling functions). |
c4fc586
to
7adfea7
Compare
I pushed unrelated commits to the wrong branch by mistake, sorry about that, I just reverted the change... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just left a comment on #669, but it seems like this PR achieves what I was thinking for that one. Now that it's a percentage of the steps, and the breathing effect is still clamped, this PR looks like a proper solution to me.
7adfea7
to
a0f71c9
Compare
@malinges I've run @jrhrsmit thanks for your work on #669! This PR has combined the good parts of both, so I'm going to go ahead with this one. I still like the ranges you added for the Kconfig, so I'm open to having a separate PR for that. |
This PR introduces two new Kconfig options
ZMK_RGB_UNDERGLOW_BRT_MIN
andZMK_RGB_UNDERGLOW_BRT_MAX
to define minimum and maximum brightness levels in percents.Use case for minimum brightness > 0: setting a >0 minimum brightness prevents keeping underglow in the "ON" state by mistake and emptying the battery very quickly on boards that have an external power mosfet.
Use case for maximum brightness < 100: limiting the maximum current consumption, especially for boards/shields that have a high number of LEDs.