feat: Add linear brightness transition option#28
feat: Add linear brightness transition option#28Nydauron wants to merge 3 commits intomikhail-m1:masterfrom
Conversation
Adds `backlight_transition`, `backlight_transition_step_count`, and `backlight_transition_time_seconds` as options to the configuration file.
7b7c11f to
f8ab3c0
Compare
|
thanks for the PR, I will try to review it properly ASAP. From the first glance I don't really understand why is separate thread is needed, and I would prefer to keep current mode as default. |
My inital thoughts were to decouple reading the light sensor + updating the Kalman filter and writing to the brightness API, because it prevents blocking between each action. If someone were to opt for a longer transition time and have a short light sensor read interval, in a synchronous threaded model, the brightness transition period would block any potential reads of the light sensor and updates to the Kalman values until the end of the transition.
Will make that change 👍. I do think it would make it a bit hard to explain just by looking at |
|
Sorry, I was really busy. I still think we shouldn't use the separate thread. If we need more time for brightness change that for getting new target value, we could have several target values waiting in the channel. And the set brightness thread will chase the outdated values. |
Allows for the option for the backlight device to gradually reach its new brightness level.
Adds
backlight_transition,backlight_transition_step_count, andbacklight_transition_time_secondsas options to the configuration file.New config options
backlight_transition: the transition mode the backlight uses to move from the current brightness to the new brightness. One of"Linear"or"Instant". Defaults to "Instant".The other two options are only read if
backlight_transitionis set toLinear:backlight_transition_step_count: How many steps should be used to get to the new brightness value. The higher the value, the smoother the transition appears. Keeping this at most to the monitor's refresh rate is advised. Defaults to 20.backlight_transition_time_seconds: The amount of time it takes to transition from the old brightness to the new brightness, in whole seconds. Defaults to 1.