瀏覽代碼

respond to reset command

Chris Mullins 8 年之前
父節點
當前提交
28181ad5a4
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      lib/WebServer/MiLightHttpServer.cpp

+ 4 - 0
lib/WebServer/MiLightHttpServer.cpp

@@ -64,6 +64,10 @@ void MiLightHttpServer::handleSystemPost() {
   if (request.containsKey("command")) {
     if (request["command"] == "restart") {
       Serial.println("Restarting...");
+      server.send(200, "text/plain", "true");
+      
+      delay(100);
+      
       ESP.restart();
     }
   }