From 58d57f7e1ac6be6895ba012e88dc13e40f229b61 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 11 Jan 2026 01:10:57 -0500 Subject: [PATCH] max global brightness --- selfdrive/ui/sunnypilot/ui_state.py | 4 ++-- selfdrive/ui/ui_state.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/sunnypilot/ui_state.py b/selfdrive/ui/sunnypilot/ui_state.py index a911349dc6..bbfbc91e2b 100644 --- a/selfdrive/ui/sunnypilot/ui_state.py +++ b/selfdrive/ui/sunnypilot/ui_state.py @@ -90,9 +90,9 @@ class DeviceSP: self._params.put_bool("OffroadMode", True) @staticmethod - def update_custom_global_brightness(brightness_override: int) -> float: + def update_max_global_brightness(brightness_override: int) -> float: """ - Updates the custom global brightness by constraining the value to a predefined range. + Updates the max global brightness by constraining the value to a predefined range. The method takes an integer `brightness` value, adjusts it to ensure it is within the range of 30 to 100, inclusive, and returns the adjusted value as a float. diff --git a/selfdrive/ui/ui_state.py b/selfdrive/ui/ui_state.py index c6dfe19941..e8c64994fc 100644 --- a/selfdrive/ui/ui_state.py +++ b/selfdrive/ui/ui_state.py @@ -263,7 +263,7 @@ class Device(DeviceSP): brightness = round(self._brightness_filter.update(clipped_brightness)) if gui_app.sunnypilot_ui() and ui_state.global_brightness_override != 0: - brightness = DeviceSP.update_custom_global_brightness(ui_state.global_brightness_override) + brightness = DeviceSP.update_max_global_brightness(ui_state.global_brightness_override) if not self._awake: brightness = 0