Made config voltage configurable

This commit is contained in:
Magnus Persson
2022-07-03 23:46:44 +02:00
parent 0c936cfb88
commit 79a3274286
10 changed files with 64 additions and 14 deletions

View File

@ -605,8 +605,10 @@ void WebServerHandler::webHandleConfigHardware() {
Log.verbose(F("WEB : %s." CR), getRequestArguments().c_str());
#endif
if (_server->hasArg(PARAM_VOLTAGEFACTOR))
myConfig.setVoltageFactor(_server->arg(PARAM_VOLTAGEFACTOR).toFloat());
if (_server->hasArg(PARAM_VOLTAGE_FACTOR))
myConfig.setVoltageFactor(_server->arg(PARAM_VOLTAGE_FACTOR).toFloat());
if (_server->hasArg(PARAM_VOLTAGE_CONFIG))
myConfig.setVoltageConfig(_server->arg(PARAM_VOLTAGE_CONFIG).toFloat());
if (_server->hasArg(PARAM_TEMP_ADJ)) {
if (myConfig.isTempC()) {
myConfig.setTempSensorAdjC(_server->arg(PARAM_TEMP_ADJ));
@ -626,7 +628,8 @@ void WebServerHandler::webHandleConfigHardware() {
myConfig.setGyroTemp(false);
if (_server->hasArg(PARAM_STORAGE_SLEEP))
myConfig.setStorageSleep(
_server->arg(PARAM_STORAGE_SLEEP).equalsIgnoreCase("on") ? true : false);
_server->arg(PARAM_STORAGE_SLEEP).equalsIgnoreCase("on") ? true
: false);
else
myConfig.setStorageSleep(false);