From db32df90b88986f25365692f88444618bc6472ea Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 28 Apr 2023 16:03:03 -0500 Subject: [PATCH] [WebUI] Use common methods for restart and erase (#1624) --- main/ZwebUI.ino | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/main/ZwebUI.ino b/main/ZwebUI.ino index 95da8e3..67f3b5d 100644 --- a/main/ZwebUI.ino +++ b/main/ZwebUI.ino @@ -430,11 +430,7 @@ void handleRoot() { delay(2000); // Wait for web page to be sent before -# if defined(ESP8266) - ESP.reset(); -# else - ESP.restart(); -# endif + ESPRestart(); } else { // WEBUI_TRACE_LOG(F("Arguments %s" CR), message); server.send(200, "text/plain", "00:14:36.767 RSL: RESULT = {\"Topic\":\"topic\"}"); @@ -888,8 +884,7 @@ void handleRT() { response += String(buffer); server.send(200, "text/html", response); - nvs_flash_erase(); - ESP.restart(); + eraseAndRestart(); } else { handleCN(); } @@ -1358,7 +1353,6 @@ String stateWebUIStatus() { WebUIdata["displayMetric"] = (bool)displayMetric; WebUIdata["webUISecure"] = (bool)webUISecure; WebUIdata["displayQueue"] = uxQueueMessagesWaiting(webUIQueue); - ; String output; serializeJson(WebUIdata, output);