mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Merge branch 'main' into feature/LEAF-charger
This commit is contained in:
commit
82379dd691
8 changed files with 179 additions and 79 deletions
|
@ -1,4 +1,7 @@
|
|||
#include "webserver.h"
|
||||
#include <Preferences.h>
|
||||
|
||||
Preferences preferences3;
|
||||
|
||||
// Create AsyncWebServer object on port 80
|
||||
AsyncWebServer server(80);
|
||||
|
@ -70,6 +73,7 @@ void init_webserver() {
|
|||
if (request->hasParam("value")) {
|
||||
String value = request->getParam("value")->value();
|
||||
BATTERY_WH_MAX = value.toInt();
|
||||
storeSettings();
|
||||
request->send(200, "text/plain", "Updated successfully");
|
||||
} else {
|
||||
request->send(400, "text/plain", "Bad Request");
|
||||
|
@ -81,6 +85,7 @@ void init_webserver() {
|
|||
if (request->hasParam("value")) {
|
||||
String value = request->getParam("value")->value();
|
||||
MAXPERCENTAGE = value.toInt() * 10;
|
||||
storeSettings();
|
||||
request->send(200, "text/plain", "Updated successfully");
|
||||
} else {
|
||||
request->send(400, "text/plain", "Bad Request");
|
||||
|
@ -92,6 +97,7 @@ void init_webserver() {
|
|||
if (request->hasParam("value")) {
|
||||
String value = request->getParam("value")->value();
|
||||
MINPERCENTAGE = value.toInt() * 10;
|
||||
storeSettings();
|
||||
request->send(200, "text/plain", "Updated successfully");
|
||||
} else {
|
||||
request->send(400, "text/plain", "Bad Request");
|
||||
|
@ -103,6 +109,7 @@ void init_webserver() {
|
|||
if (request->hasParam("value")) {
|
||||
String value = request->getParam("value")->value();
|
||||
MAXCHARGEAMP = value.toInt() * 10;
|
||||
storeSettings();
|
||||
request->send(200, "text/plain", "Updated successfully");
|
||||
} else {
|
||||
request->send(400, "text/plain", "Bad Request");
|
||||
|
@ -114,6 +121,7 @@ void init_webserver() {
|
|||
if (request->hasParam("value")) {
|
||||
String value = request->getParam("value")->value();
|
||||
MAXDISCHARGEAMP = value.toInt() * 10;
|
||||
storeSettings();
|
||||
request->send(200, "text/plain", "Updated successfully");
|
||||
} else {
|
||||
request->send(400, "text/plain", "Bad Request");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue