mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Merge pull request #1425 from jonny5532/feature/more-inverter-settings
Make more inverter settings configurable
This commit is contained in:
commit
4a24f3558f
14 changed files with 321 additions and 48 deletions
|
@ -414,7 +414,7 @@ void init_webserver() {
|
|||
|
||||
const char* boolSettingNames[] = {
|
||||
"DBLBTR", "CNTCTRL", "CNTCTRLDBL", "PWMCNTCTRL", "PERBMSRESET", "REMBMSRESET",
|
||||
"CANFDASCAN", "WIFIAPENABLED", "MQTTENABLED", "HADISC", "MQTTTOPICS",
|
||||
"CANFDASCAN", "WIFIAPENABLED", "MQTTENABLED", "HADISC", "MQTTTOPICS", "INVICNT",
|
||||
};
|
||||
|
||||
// Handles the form POST from UI to save settings of the common image
|
||||
|
@ -494,6 +494,27 @@ 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);
|
||||
} else if (p->name() == "INVCELLS") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("INVCELLS", type);
|
||||
} else if (p->name() == "INVMODULES") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("INVMODULES", type);
|
||||
} else if (p->name() == "INVCELLSPER") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("INVCELLSPER", type);
|
||||
} else if (p->name() == "INVVLEVEL") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("INVVLEVEL", type);
|
||||
} else if (p->name() == "INVCAPACITY") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("INVCAPACITY", type);
|
||||
} else if (p->name() == "INVBTYPE") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("INVBTYPE", (int)type);
|
||||
}
|
||||
|
||||
for (auto& boolSetting : boolSettings) {
|
||||
|
@ -579,10 +600,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