firmware wip - add basic manual pump on POST

This commit is contained in:
Marcus 2024-06-16 20:53:29 +02:00
parent 54fec62a3e
commit a51cd81651
2 changed files with 8 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/* CanGrow_Version.h gets generated from cangrow.sh */
const char* CanGrowVer = "0.1-dev";
const char* CanGrowBuild = "e1fcb09-20240616201039";
const char* CanGrowBuild = "54fec62-20240616204659";

View file

@ -1022,6 +1022,12 @@ void POSTsetOutput() {
}
void POSTsetPumpManual() {
PumpOnManual = webserver.arg("PumpOnManual").toInt();
webserver.sendHeader("Location", String("/?success"), true);
webserver.send(302, "text/plain", "switch: success!\n");
}
/*
* API section
@ -1179,6 +1185,7 @@ void WebHandler() {
// switching MOSFETs
webserver.on("/switch", HTTP_POST, POSTsetOutput);
webserver.on("/pumpManual", HTTP_POST, POSTsetPumpManual);
// api stuff
webserver.on("/api/sensors", HTTP_GET, APIgetSensors);