Changed to include Update.h certainly

pull/197/head
Hieromon Ikasamo 4 years ago
parent db811f2c78
commit de615b3738
  1. 10
      src/AutoConnectOTA.cpp

@ -10,6 +10,7 @@
#include <functional> #include <functional>
#if defined(ARDUINO_ARCH_ESP8266) #if defined(ARDUINO_ARCH_ESP8266)
#include <WiFiUdp.h> #include <WiFiUdp.h>
#include <Updater.h>
#elif defined(ARDUINO_ARCH_ESP32) #elif defined(ARDUINO_ARCH_ESP32)
#include <Update.h> #include <Update.h>
#endif #endif
@ -205,11 +206,10 @@ String AutoConnectOTA::_updated(AutoConnectAux& result, PageArgument& args) {
result["bin"].as<AutoConnectText>().style += String(stColor); result["bin"].as<AutoConnectText>().style += String(stColor);
result["result"].as<AutoConnectText>().value = st; result["result"].as<AutoConnectText>().value = st;
// The rc element on the result page has an update return code // AutoConnectOTA result page generates a transition after reboot
// which is a hidden field. // according to the error code from the Update class. By setting the
// By setting the error code of the Update class into its field, // error code of the Update class into the rc element, this page will
// the homepage after reboot will automatically GET by the JavaScript // automatically GET the homepage of the updated sketch.
// on the result page.
result["rc"].value.replace("%d", String(Update.getError())); result["rc"].value.replace("%d", String(Update.getError()));
return String(""); return String("");
} }

Loading…
Cancel
Save