From 27b20a945e8287e90d6e7bc1c1b67536dfddb8fd Mon Sep 17 00:00:00 2001 From: MayNiklas Date: Thu, 26 Mar 2026 14:58:45 +0100 Subject: [PATCH] fix: reload native apps on settings change without reboot Also removes stale reboot notice from native app toggle docs. --- docs/api.md | 10 +++++----- src/DisplayManager.cpp | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/api.md b/docs/api.md index 9556a83f..faa377ac 100644 --- a/docs/api.md +++ b/docs/api.md @@ -400,11 +400,11 @@ You can adjust each property in the JSON object according to your preferences. I | `HUM_COL` | string/array of ints | Text color of the humidity app. Use 0 for global text color. | RGB array or hex color | N/A | | `BAT_COL` | string/array of ints | Text color of the battery app. Use 0 for global text color. | RGB array or hex color | N/A | | `SSPEED` | integer | Scroll speed modification. | Percentage of original scroll speed | 100 | -| `TIM` | boolean | Enable or disable the native time app (requires reboot). | `true`/`false` | true | -| `DAT` | boolean | Enable or disable the native date app (requires reboot). | `true`/`false` | true | -| `HUM` | boolean | Enable or disable the native humidity app (requires reboot). | `true`/`false` | true | -| `TEMP` | boolean | Enable or disable the native temperature app (requires reboot). | `true`/`false` | true | -| `BAT` | boolean | Enable or disable the native battery app (requires reboot). | `true`/`false` | true | +| `TIM` | boolean | Enable or disable the native time app. | `true`/`false` | true | +| `DAT` | boolean | Enable or disable the native date app. | `true`/`false` | true | +| `HUM` | boolean | Enable or disable the native humidity app. | `true`/`false` | true | +| `TEMP` | boolean | Enable or disable the native temperature app. | `true`/`false` | true | +| `BAT` | boolean | Enable or disable the native battery app. | `true`/`false` | true | | `MATP` | boolean | Enable or disable the matrix. Similar to `power` endpoint but without the animation. | `true`/`false` | true | | `VOL` | integer | Allows to set the volume of the buzzer and DFplayer. | 0–30 | true | | `OVERLAY` | string | Sets a global effect overlay (cannot be used with app specific overlays). | Varies (see below) | N/A | diff --git a/src/DisplayManager.cpp b/src/DisplayManager.cpp index a3ef09d6..191f5176 100644 --- a/src/DisplayManager.cpp +++ b/src/DisplayManager.cpp @@ -2126,6 +2126,7 @@ void DisplayManager_::setNewSettings(const char *json) UPPERCASE_LETTERS = doc.containsKey("UPPERCASE") ? doc["UPPERCASE"].as() : UPPERCASE_LETTERS; SHOW_WEEKDAY = doc.containsKey("WD") ? doc["WD"].as() : SHOW_WEEKDAY; BLOCK_NAVIGATION = doc.containsKey("BLOCKN") ? doc["BLOCKN"].as() : BLOCK_NAVIGATION; + bool nativeAppsChanged = doc.containsKey("TIM") || doc.containsKey("DAT") || doc.containsKey("HUM") || doc.containsKey("TEMP") || doc.containsKey("BAT"); SHOW_TIME = doc.containsKey("TIM") ? doc["TIM"].as() : SHOW_TIME; SHOW_DATE = doc.containsKey("DAT") ? doc["DAT"].as() : SHOW_DATE; SHOW_HUM = doc.containsKey("HUM") ? doc["HUM"].as() : SHOW_HUM; @@ -2249,6 +2250,8 @@ void DisplayManager_::setNewSettings(const char *json) } doc.clear(); applyAllSettings(); + if (nativeAppsChanged) + loadNativeApps(); saveSettings(); if (DEBUG_MODE) DEBUG_PRINTLN("Settings loaded");