From fa9234afa0b4151fd2b1e8a5b53c7c51ca67ff28 Mon Sep 17 00:00:00 2001 From: Kumar <36933347+rav4kumar@users.noreply.github.com> Date: Sat, 16 Nov 2024 12:00:39 -0700 Subject: [PATCH] ui: Fix Night Brightness (#33984) --- selfdrive/ui/ui.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 5d6b6c5722..a9c593b558 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -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 \ No newline at end of file +#endif