diff --git a/main.ino b/main.ino
index 11f68a5..d67cab7 100644
--- a/main.ino
+++ b/main.ino
@@ -205,7 +205,6 @@ void handleRoot() {
String("") +
"
presence" +
"Admin
" +
- "fuzisopen API
" +
"Rotating light: " + String(digitalRead(RELAY_PIN) == HIGH) + "
" +
"Fuz is open: " + String(fuzIsOpen) + "
" +
"";
@@ -228,6 +227,13 @@ void handleAdmin() {
fuzIsOpen = true;
continue;
}
+ if (httpServer.argName(i) == "resetesp") {
+ httpServer.sendHeader("Location", httpServer.uri(), true);
+ httpServer.send(302, "text/plain", "");
+ delay(500);
+ ESP.reset();
+ return;
+ }
}
if (httpServer.method() == HTTP_POST) {
@@ -267,7 +273,7 @@ void handleAdmin() {
configFile.close();
}
if (httpServer.args() > 0 || httpServer.method() == HTTP_POST) { // trim GET parameters and prevent resubmiting same form on refresh
- httpServer.sendHeader("Location", String("/admin"), true);
+ httpServer.sendHeader("Location", httpServer.uri(), true);
return httpServer.send(302, "text/plain", "");
}
@@ -275,7 +281,8 @@ void handleAdmin() {
String("") +
"presence admin" +
(digitalRead(RELAY_PIN) == HIGH ? "Disable rotating light" : "Enable rotating light") + "
" +
- (fuzIsOpen ? "" : "Set Fuz as open") + "
" +
+ (fuzIsOpen ? "" : "Set Fuz as open") + "
" +
+ "Reboot ESP" + "
" +
"