Rename user specified limit in datalayer

This commit is contained in:
Daniel Öster 2024-11-08 23:37:16 +02:00
parent 710a7339d8
commit 91f3c8caf9
4 changed files with 13 additions and 13 deletions

View file

@ -57,11 +57,11 @@ String settings_processor(const String& var) {
content += "<h4 style='color: " + String(datalayer.battery.settings.soc_scaling_active ? "white" : "darkgrey") +
";'>SOC min percentage: " + String(datalayer.battery.settings.min_percentage / 100.0, 1) +
" </span> <button onclick='editSocMin()'>Edit</button></h4>";
content +=
"<h4 style='color: white;'>Max charge speed: " + String(datalayer.battery.info.max_charge_amp_dA / 10.0, 1) +
" A </span> <button onclick='editMaxChargeA()'>Edit</button></h4>";
content += "<h4 style='color: white;'>Max charge speed: " +
String(datalayer.battery.info.max_user_set_charge_dA / 10.0, 1) +
" A </span> <button onclick='editMaxChargeA()'>Edit</button></h4>";
content += "<h4 style='color: white;'>Max discharge speed: " +
String(datalayer.battery.info.max_discharge_amp_dA / 10.0, 1) +
String(datalayer.battery.info.max_user_set_discharge_dA / 10.0, 1) +
" A </span> <button onclick='editMaxDischargeA()'>Edit</button></h4>";
// Close the block
content += "</div>";

View file

@ -209,7 +209,7 @@ void init_webserver() {
return request->requestAuthentication();
if (request->hasParam("value")) {
String value = request->getParam("value")->value();
datalayer.battery.info.max_charge_amp_dA = static_cast<uint16_t>(value.toFloat() * 10);
datalayer.battery.info.max_user_set_charge_dA = static_cast<uint16_t>(value.toFloat() * 10);
storeSettings();
request->send(200, "text/plain", "Updated successfully");
} else {
@ -223,7 +223,7 @@ void init_webserver() {
return request->requestAuthentication();
if (request->hasParam("value")) {
String value = request->getParam("value")->value();
datalayer.battery.info.max_discharge_amp_dA = static_cast<uint16_t>(value.toFloat() * 10);
datalayer.battery.info.max_user_set_discharge_dA = static_cast<uint16_t>(value.toFloat() * 10);
storeSettings();
request->send(200, "text/plain", "Updated successfully");
} else {
@ -285,7 +285,7 @@ void init_webserver() {
String value = request->getParam("value")->value();
float val = value.toFloat();
if (!(val <= datalayer.battery.info.max_charge_amp_dA && val <= CHARGER_MAX_A)) {
if (!(val <= datalayer.battery.info.max_user_set_charge_dA && val <= CHARGER_MAX_A)) {
request->send(400, "text/plain", "Bad Request");
}