diff --git a/src/AsyncFsWebServer.cpp b/src/AsyncFsWebServer.cpp index 9aea70fd..e0cfccf7 100644 --- a/src/AsyncFsWebServer.cpp +++ b/src/AsyncFsWebServer.cpp @@ -13,7 +13,7 @@ bool AsyncFsWebServer::init(AwsEventHandler wsHandle) { file = m_filesystem->open(ESP_FS_WS_CONFIG_FILE, "r"); if (!file) { file = m_filesystem->open(ESP_FS_WS_CONFIG_FILE, "w"); - file.print("{\"wifi-box\": \"\"}"); + file.print("{\"wifi-box\": \"\",\n\t\"dhcp\": false}"); file.close(); } else file.close(); diff --git a/src/SetupConfig.hpp b/src/SetupConfig.hpp index 6271391f..451f452e 100644 --- a/src/SetupConfig.hpp +++ b/src/SetupConfig.hpp @@ -30,7 +30,7 @@ class SetupConfigurator log_error("Error. File %s not created", ESP_FS_WS_CONFIG_FILE); return false; } - file.print("{\"wifi-box\": \"\"}"); + file.print("{\"wifi-box\": \"\",\"dhcp\":false}"); file.close(); } return true; @@ -231,7 +231,7 @@ class SetupConfigurator key += numOptions ; // If key is present and value is the same, we don't need to create/update it. - if (doc.containsKey(key.c_str()) && doc[key] != val) + if (doc.containsKey(key.c_str()) && doc[key] == val) return; // if min, max, step != from default, treat this as object in order to set other properties