From 4ca40ca0f0a8bfd639ced3540e045df547ef2c80 Mon Sep 17 00:00:00 2001 From: Thomas Hagenmaier Date: Thu, 15 Feb 2024 11:11:39 +0100 Subject: [PATCH] =?UTF-8?q?-=20Bugfix:=20Vermeide=20unn=C3=B6tige=20writeC?= =?UTF-8?q?onfig()=20Aufrufe=20durch:=201.=20Eintr=C3=A4ge=20ohne=20'name'?= =?UTF-8?q?=20Attribut=20ausgel=C3=B6st=202.=20fehlendes=20R=C3=BCcksetzen?= =?UTF-8?q?=20von=20bo=5FhasNewKeys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WebSettings.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/WebSettings.cpp b/src/WebSettings.cpp index 0e4f3f2..57e658c 100644 --- a/src/WebSettings.cpp +++ b/src/WebSettings.cpp @@ -210,7 +210,13 @@ void WebSettings::initWebSettings(const char *parameter, String confName, String readConfig(); } getDefaultValuesFromNewKeys(parameterFile, 8); - if(bo_hasNewKeys) writeConfig(); + + if(bo_hasNewKeys) + { + writeConfig(); + bo_hasNewKeys = false; + } + #ifdef WEBSET_DEBUG BSC_LOGI(TAG, "initWebSettings() end"); #endif @@ -681,7 +687,7 @@ void WebSettings::getDefaultValuesFromNewKeys(const char *parameter, uint32_t js retStr_default=""; json.getValue(parameter, a, "default", jsonStartPos, retStr_default, u32_tmp); - if(isKeyExist(jsonName, u8_dataType)==false) + if((jsonNameBase!= 0) && (isKeyExist(jsonName, u8_dataType)==false)) { bo_hasNewKeys=true; uint16_t id=0; @@ -693,7 +699,7 @@ void WebSettings::getDefaultValuesFromNewKeys(const char *parameter, uint32_t js } else { - if(prefs.isKey(String(jsonName).c_str())==false) + if((jsonNameBase != 0) && (prefs.isKey(String(jsonName).c_str())==false)) { bo_hasNewKeys=true; retStr_default="";