mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Fix equipmentt stop button and remove dupe code
This commit is contained in:
parent
fc13e69e91
commit
dfdd834e32
1 changed files with 1 additions and 9 deletions
|
@ -594,14 +594,6 @@ void init_webserver() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
update_string("/equipmentStop", [](String value) {
|
|
||||||
if (value == "true" || value == "1") {
|
|
||||||
setBatteryPause(true, false, true); //Pause battery, do not pause CAN, equipment stop on (store to flash)
|
|
||||||
} else {
|
|
||||||
setBatteryPause(false, false, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Route for editing SOCMin
|
// Route for editing SOCMin
|
||||||
update_string_setting("/updateSocMin", [](String value) {
|
update_string_setting("/updateSocMin", [](String value) {
|
||||||
datalayer.battery.settings.min_percentage = static_cast<uint16_t>(value.toFloat() * 100);
|
datalayer.battery.settings.min_percentage = static_cast<uint16_t>(value.toFloat() * 100);
|
||||||
|
@ -1415,7 +1407,7 @@ String processor(const String& var) {
|
||||||
content +=
|
content +=
|
||||||
"var xhr=new "
|
"var xhr=new "
|
||||||
"XMLHttpRequest();xhr.onload=function() { "
|
"XMLHttpRequest();xhr.onload=function() { "
|
||||||
"window.location.reload();};xhr.open('GET','/equipmentStop?stop='+stop,true);xhr.send();";
|
"window.location.reload();};xhr.open('GET','/equipmentStop?value='+stop,true);xhr.send();";
|
||||||
content += "}";
|
content += "}";
|
||||||
content += "</script>";
|
content += "</script>";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue