Many changes - not yet "controlled" updates.

This commit is contained in:
David
2021-10-04 13:45:39 +00:00
parent 8c1a403008
commit 74543a99f8
42 changed files with 7718 additions and 0 deletions

33
Firmware/Web_RootPage.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <ESP8266WiFi.h>
#include "ProjGlobals.h"
#include "Web_RootPage.h"
#include "GrowController.h"
#include "Web_Resources.h"
void HandleRootPage() {
if (server.hasArg("SW")) {
String newState = server.arg("SW");
if (newState == "1") {
SetCircuit(CMD_On);
Serial.printf("SW 1\n");
} else if (newState == "0") {
SetCircuit(CMD_Off);
Serial.printf("SW 0\n");
} else if (newState == "2") {
SetCircuit(CMD_Toggle);
Serial.printf("SW 2\n");
} else {
Serial.printf("SW %s ???\n", newState.c_str());
; // no action
}
}
String modeText = (isStationMode) ? "Station mode<br/>" : "Access Point mode<br/>";
String status = GetCircuitStatus() ? "On<br/>" : "Off<br/>";
String myIP = String(WiFi.localIP()[0]);
myIP += "." + String(WiFi.localIP()[1]);
myIP += "." + String(WiFi.localIP()[2]);
myIP += "." + String(WiFi.localIP()[3]);
server.send_P(200, "text/html", index_htm);
}