Преглед на файлове

corrected the "clear_wifi_config" functions with WiFiManagers "resetSettings()". This should solve #120

Marcel Jira преди 8 години
родител
ревизия
b046fcf947
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      lib/WebServer/MiLightHttpServer.cpp

+ 3 - 1
lib/WebServer/MiLightHttpServer.cpp

@@ -7,6 +7,7 @@
 #include <string.h>
 #include <TokenIterator.h>
 #include <index.html.gz.h>
+#include <WiFiManager.h>
 
 void MiLightHttpServer::begin() {
   applySettings(settings);
@@ -111,7 +112,8 @@ void MiLightHttpServer::handleSystemPost() {
         server.send_P(200, TEXT_PLAIN, PSTR("true"));
 
         delay(100);
-        ESP.eraseConfig();
+        WiFiManager wifiManager;
+        wifiManager.resetSettings();
         delay(100);
         ESP.restart();