Compare commits

...

9 Commits

Author SHA1 Message Date
Jason Wen 58d57f7e1a max global brightness 2026-01-11 01:10:57 -05:00
Jason Wen 9cbc91d129 read 2026-01-11 00:57:47 -05:00
Jason Wen 764ff0db6a update immediately 2026-01-11 00:55:08 -05:00
Jason Wen 8faedaa062 lint 2026-01-11 00:32:22 -05:00
Jason Wen 4cc43ae6f5 override properly and clip to 30% minimum 2026-01-11 00:10:30 -05:00
Jason Wen 578e80855a do not touch light sensor logic 2026-01-10 23:49:17 -05:00
DevTekVE 66c335113e Reapply "ui: Global Brightness Override (#1579)"
This reverts commit a0c10be1ff.
2026-01-10 21:25:33 +01:00
DevTekVE a0c10be1ff Revert "ui: Global Brightness Override (#1579)"
This reverts commit 1eb82fcc
2026-01-10 21:24:44 +01:00
Nayan a58db66a98 sunnylink: add units to param metadata (#1643)
add units
2026-01-09 18:40:09 -05:00
3 changed files with 82 additions and 16 deletions
+19
View File
@@ -88,3 +88,22 @@ class DeviceSP:
def _set_awake(self, on: bool):
if on and self._params.get("DeviceBootMode", return_default=True) == 1:
self._params.put_bool("OffroadMode", True)
@staticmethod
def update_max_global_brightness(brightness_override: int) -> float:
"""
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.
This method only runs if 0 (Auto) is not selected.
:param brightness_override: The desired brightness level. It is constrained between
a minimum of 30 and a maximum of 100.
:type brightness_override: int
:return: The brightness value adjusted to fit within the allowable range,
converted to a float.
:rtype: float
"""
return float(min(max(brightness_override, 30), 100))
+3 -8
View File
@@ -258,17 +258,12 @@ class Device(DeviceSP):
else:
clipped_brightness = ((clipped_brightness + 16.0) / 116.0) ** 3.0
if gui_app.sunnypilot_ui():
if ui_state.global_brightness_override <= 0:
min_global_brightness = 1 if ui_state.global_brightness_override < 0 else 30
clipped_brightness = float(np.interp(clipped_brightness, [0, 1], [min_global_brightness, 100]))
else:
clipped_brightness = float(np.interp(clipped_brightness, [0, 1], [30, 100]))
clipped_brightness = float(np.interp(clipped_brightness, [0, 1], [30, 100]))
brightness = round(self._brightness_filter.update(clipped_brightness))
if gui_app.sunnypilot_ui() and ui_state.global_brightness_override > 0:
brightness = ui_state.global_brightness_override
if gui_app.sunnypilot_ui() and ui_state.global_brightness_override != 0:
brightness = DeviceSP.update_max_global_brightness(ui_state.global_brightness_override)
if not self._awake:
brightness = 0
+60 -8
View File
@@ -126,11 +126,13 @@
"description": "Virtually shift camera's perspective to move model's center to Left(+ values) or Right (- values)",
"min": -0.35,
"max": 0.35,
"step": 0.01
"step": 0.01,
"unit": "meters"
},
"CarBatteryCapacity": {
"title": "Car Battery Capacity",
"description": ""
"description": "Battery Size",
"unit": "kWh"
},
"CarList": {
"title": "Supported Car List",
@@ -396,7 +398,8 @@
},
"InteractivityTimeout": {
"title": "Interactivity Timeout",
"description": ""
"description": "",
"unit": "seconds"
},
"IsDevelopmentBranch": {
"title": "Is Development Branch",
@@ -630,7 +633,8 @@
},
"MaxTimeOffroad": {
"title": "Max Time Offroad",
"description": ""
"description": "",
"unit": "seconds"
},
"ModelManager_ActiveBundle": {
"title": "Model Manager Active Bundle",
@@ -784,9 +788,56 @@
"OnroadScreenOffTimer": {
"title": "Onroad Brightness Delay",
"description": "",
"min": 0,
"max": 60,
"step": 1
"options": [
{
"value": 15,
"label": "15s"
},
{
"value": 30,
"label": "30s"
},
{
"value": 60,
"label": "1m"
},
{
"value": 120,
"label": "2m"
},
{
"value": 180,
"label": "3m"
},
{
"value": 240,
"label": "4m"
},
{
"value": 300,
"label": "5m"
},
{
"value": 360,
"label": "6m"
},
{
"value": 420,
"label": "7m"
},
{
"value": 480,
"label": "8m"
},
{
"value": 540,
"label": "9m"
},
{
"value": 600,
"label": "10m"
}
]
},
"OnroadUploads": {
"title": "Onroad Uploads",
@@ -1060,7 +1111,8 @@
"description": "",
"min": 0.1,
"max": 5.0,
"step": 0.1
"step": 0.1,
"unit": "m/s²"
},
"ToyotaEnforceStockLongitudinal": {
"title": "Toyota: Enforce Factory Longitudinal Control",