From fc9372b2ece86ebb9cb15099a322547bd453f103 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 9 Sep 2024 16:41:23 +0200 Subject: [PATCH] string casting --- src/web/WebSettingsService.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index 23dfe45c7..25c22dcc4 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -97,9 +97,9 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { #endif #ifdef EMSESP_DEBUG - EMSESP::logger().debug("NVS boot value is %s, board profile is %s, EMSESP_DEFAULT_BOARD_PROFILE is %s", + EMSESP::logger().debug("NVS boot value = [%s] board profile = [%s] EMSESP_DEFAULT_BOARD_PROFILE = [%s]", EMSESP::nvs_.getString("boot").c_str(), - root["board_profile"].as(), + root["board_profile"] | "", EMSESP_DEFAULT_BOARD_PROFILE); #endif @@ -185,7 +185,9 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { System::load_board_profile(data, settings.board_profile.c_str()); EMSESP::logger().warning("No Board profile setup - using %s", settings.board_profile.c_str()); } else { + // board profile is a valid one and data has been loaded if (old_board_profile != settings.board_profile) { + // see if need to override the set board profile (e.g. forced by NVS boot string) EMSESP::logger().info("Applying new Board profile %s (was %s)", settings.board_profile.c_str(), old_board_profile.c_str()); } else { EMSESP::logger().info("Board profile set to %s", settings.board_profile.c_str());