Skip to content

Commit

Permalink
Merge pull request #46 from GregAscolab/asl
Browse files Browse the repository at this point in the history
Missing mandatory "dhcp" option + Wrong logical test !!!
  • Loading branch information
cotestatnt authored Sep 8, 2024
2 parents 8a1e732 + 19260f4 commit c7a3592
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AsyncFsWebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/SetupConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c7a3592

Please sign in to comment.