formatting

This commit is contained in:
proddy
2024-09-10 10:19:56 +02:00
parent ab40a21805
commit 79e2d6b4a5

View File

@@ -97,7 +97,7 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
#endif #endif
#ifdef EMSESP_DEBUG #ifdef EMSESP_DEBUG
EMSESP::logger().debug("NVS boot value = [%s] board profile = [%s] EMSESP_DEFAULT_BOARD_PROFILE = [%s]", EMSESP::logger().debug("NVS boot value=[%s], board profile=[%s], EMSESP_DEFAULT_BOARD_PROFILE=[%s]",
EMSESP::nvs_.getString("boot").c_str(), EMSESP::nvs_.getString("boot").c_str(),
root["board_profile"] | "", root["board_profile"] | "",
EMSESP_DEFAULT_BOARD_PROFILE); EMSESP_DEFAULT_BOARD_PROFILE);
@@ -114,6 +114,9 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
if (!EMSESP::system_.getBBQKeesGatewayDetails().isEmpty()) { if (!EMSESP::system_.getBBQKeesGatewayDetails().isEmpty()) {
String nvs_boot = EMSESP::nvs_.getString("boot"); String nvs_boot = EMSESP::nvs_.getString("boot");
if (!nvs_boot.isEmpty()) { if (!nvs_boot.isEmpty()) {
#ifdef EMSESP_DEBUG
EMSESP::logger().debug("Overriding board profile with NVS boot value %s");
#endif
settings.board_profile = nvs_boot; settings.board_profile = nvs_boot;
} }
} }
@@ -187,16 +190,14 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
// apply the new board profile setting // apply the new board profile setting
System::load_board_profile(data, settings.board_profile.c_str()); 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) { if (old_board_profile != settings.board_profile) {
// see if need to override the set board profile (e.g. forced by NVS boot string) // 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()); EMSESP::logger().info("Setting new Board profile %s (was %s)", settings.board_profile.c_str(), old_board_profile.c_str());
} else { } else {
EMSESP::logger().info("Board profile set to %s", settings.board_profile.c_str()); EMSESP::logger().info("Board profile set to %s", settings.board_profile.c_str());
} }
}
int prev; int prev;
reset_flags(); reset_flags();