From cc3c5891336d0b30c60c995b0d828deaa43a7f74 Mon Sep 17 00:00:00 2001 From: lorol Date: Thu, 12 Mar 2020 21:42:13 -0400 Subject: [PATCH] --- examples/SmartSwitch/SmartSwitch.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/SmartSwitch/SmartSwitch.ino b/examples/SmartSwitch/SmartSwitch.ino index 11d17e7..90aca030 100644 --- a/examples/SmartSwitch/SmartSwitch.ino +++ b/examples/SmartSwitch/SmartSwitch.ino @@ -10,7 +10,7 @@ Based on ESP_AsyncFSBrowser Real Time (NTP) w/ Time Zones Memorized settings to EEPROM Multiple clients can be connected at same time, they see each other requests -Use latest ESP core lib (from github) +Use latest ESP core lib (from Github) */ #define USE_WFM // to use ESPAsyncWiFiManager @@ -452,6 +452,11 @@ void setup(){ server.on("/erase-wifi", HTTP_GET, [](AsyncWebServerRequest *request){ request->onDisconnect([]() { WiFi.disconnect(true); +#ifdef ESP32 + ESP.restart(); +#elif defined(ESP8266) + ESP.reset(); +#endif }); request->send(200, "text/plain","Erasing WiFi data ..."); });