mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Move SOFAR_ID to new setting mechanism.
This commit is contained in:
parent
ce1f8955e9
commit
7a2e2519cd
3 changed files with 18 additions and 14 deletions
|
@ -494,6 +494,9 @@ void init_webserver() {
|
|||
settings.saveString("MQTTDEVICENAME", p->value().c_str());
|
||||
} else if (p->name() == "HADEVICEID") {
|
||||
settings.saveString("HADEVICEID", p->value().c_str());
|
||||
} else if (p->name() == "SOFAR_ID") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("SOFAR_ID", type);
|
||||
}
|
||||
|
||||
for (auto& boolSetting : boolSettings) {
|
||||
|
@ -579,10 +582,6 @@ void init_webserver() {
|
|||
update_string_setting(route, [setter](String value) { setter(value.toInt()); });
|
||||
};
|
||||
|
||||
// Route for editing Sofar ID
|
||||
update_int_setting("/updateSofarID",
|
||||
[](int value) { datalayer.battery.settings.sofar_user_specified_battery_id = value; });
|
||||
|
||||
// Route for editing Wh
|
||||
update_int_setting("/updateBatterySize", [](int value) { datalayer.battery.info.total_capacity_Wh = value; });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue