From 5bc250888f0b24fe11cddfe3a3c739b877db5031 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sat, 16 May 2026 23:15:29 +0200 Subject: [PATCH] fix: apply saved display brightness before UI task starts Loading... screen was always shown at full brightness because prefs are not yet loaded at that point. Apply setBrightness() in the first common code path after the_mesh.begin() loads prefs, so at least the tail of the loading screen and the entire splash screen respect the saved brightness level. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 751de330..879d04be 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -219,6 +219,10 @@ void setup() { #endif #ifdef DISPLAY_CLASS + // Apply saved brightness as soon as prefs are available so the tail of + // the loading screen is not stuck at full brightness. + if (disp && the_mesh.getNodePrefs()) + disp->setBrightness(the_mesh.getNodePrefs()->display_brightness); ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved #endif