Setting voltage for battery is always fake

This commit is contained in:
Jaakko Haakana 2025-06-01 13:43:57 +03:00
parent 6bd0865195
commit 0eb852997c
4 changed files with 8 additions and 8 deletions

View file

@ -601,7 +601,7 @@ void init_webserver() {
});
// Route for editing FakeBatteryVoltage
server.on("/updateBatteryVoltage", HTTP_GET, [](AsyncWebServerRequest* request) {
server.on("/updateFakeBatteryVoltage", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
if (!request->hasParam("value")) {
@ -611,7 +611,7 @@ void init_webserver() {
String value = request->getParam("value")->value();
float val = value.toFloat();
battery->set_voltage(val);
battery->set_fake_voltage(val);
request->send(200, "text/plain", "Updated successfully");
});