From ae98027ced97987a9d6677cc9274f02f511354ed Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 8 Sep 2024 16:01:44 +0200 Subject: [PATCH] only override board profile for BBQKees boards --- src/web/WebSettingsService.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index 99e671296..545467203 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -107,11 +107,15 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE; // this is set at compile time in platformio.ini, other it's "default" String old_board_profile = settings.board_profile; - // The optional NVS boot value has priority and overrides any board_profile setting. Note, we never set the NVS boot value in the code - this is done on initial pre-loading - // Note: The board profile is dynamically changed for the session, but the value in the settings file on the FS remains untouched - String nvs_boot = EMSESP::nvs_.getString("boot"); - if (!nvs_boot.isEmpty()) { - settings.board_profile = nvs_boot; + // The optional NVS boot value has priority and overrides any board_profile setting. + // We only do this for BBQKees boards + // Note 1: we never set the NVS boot value in the code - this is done on initial pre-loading + // Note 2: The board profile is dynamically changed for the session, but the value in the settings file on the FS remains untouched + if (!EMSESP::system_.getBBQKeesGatewayDetails().isEmpty()) { + String nvs_boot = EMSESP::nvs_.getString("boot"); + if (!nvs_boot.isEmpty()) { + settings.board_profile = nvs_boot; + } } // load the board profile from the settings, if it's not "default"