mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-23 20:52:06 +08:00
ui: Fix Night Brightness (#33984)
This commit is contained in:
+3
-3
@@ -326,7 +326,7 @@ void Device::resetInteractiveTimeout(int timeout) {
|
||||
|
||||
void Device::updateBrightness(const UIState &s) {
|
||||
clipped_brightness = offroad_brightness;
|
||||
if (s.scene.started && s.scene.light_sensor > 0) {
|
||||
if (s.scene.started && s.scene.light_sensor >= 0) {
|
||||
clipped_brightness = s.scene.light_sensor;
|
||||
|
||||
// CIE 1931 - https://www.photonstophotos.net/GeneralTopics/Exposure/Psychometric_Lightness_and_Gamma.htm
|
||||
@@ -337,7 +337,7 @@ void Device::updateBrightness(const UIState &s) {
|
||||
}
|
||||
|
||||
// Scale back to 10% to 100%
|
||||
clipped_brightness = std::clamp(100.0f * clipped_brightness, 10.0f, 100.0f);
|
||||
clipped_brightness = std::clamp(100.0f * clipped_brightness, 5.0f, 100.0f);
|
||||
}
|
||||
RETURN_IF_SUNNYPILOT
|
||||
|
||||
@@ -377,4 +377,4 @@ Device *device() {
|
||||
static Device _device;
|
||||
return &_device;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user