Merge branch '0_15' into bus-config

This commit is contained in:
Blaž Kristan
2024-09-12 08:49:04 +02:00
33 changed files with 373 additions and 279 deletions

View File

@@ -157,8 +157,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
char la[4] = "LA"; la[2] = offset+s; la[3] = 0; //LED mA
char ma[4] = "MA"; ma[2] = offset+s; ma[3] = 0; //max mA
if (!request->hasArg(lp)) {
DEBUG_PRINT(F("No data for "));
DEBUG_PRINTLN(s);
DEBUG_PRINTF_P(PSTR("No data for %d\n"), s);
break;
}
for (int i = 0; i < 5; i++) {
@@ -728,7 +727,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
else subObj[name].add(value.toInt()); // we may have an int
j++;
}
DEBUG_PRINT(F("[")); DEBUG_PRINT(j); DEBUG_PRINT(F("] = ")); DEBUG_PRINTLN(value);
DEBUG_PRINTF_P(PSTR("[%d] = %s\n"), j, value.c_str());
} else {
// we are using a hidden field with the same name as our parameter (!before the actual parameter!)
// to describe the type of parameter (text,float,int), for boolean parameters the first field contains "off"
@@ -747,7 +746,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
} else if (type == "int") subObj[name] = value.toInt();
else subObj[name] = value; // text fields
}
DEBUG_PRINT(F(" = ")); DEBUG_PRINTLN(value);
DEBUG_PRINTF_P(PSTR(" = %s\n"), value.c_str());
}
}
usermods.readFromConfig(um); // force change of usermod parameters
@@ -808,8 +807,7 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
if (!(req.indexOf("win") >= 0)) return false;
int pos = 0;
DEBUG_PRINT(F("API req: "));
DEBUG_PRINTLN(req);
DEBUG_PRINTF_P(PSTR("API req: %s\n"), req.c_str());
//segment select (sets main segment)
pos = req.indexOf(F("SM="));