Another HTTP API segment improvement

This commit is contained in:
cschwinne 2022-02-21 18:31:19 +01:00
parent 694466a196
commit 1f5971f15a
2 changed files with 11 additions and 9 deletions

View File

@ -612,14 +612,6 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
byte selectedSeg = strip.getMainSegmentId();
if (selectedSeg != prevMain) setValuesFromMainSeg();
//temporary values, do not write direcly to global values of only setting a single segment
byte colIn[4] = {col[0], col[1], col[2], col[3]};
byte colInSec[4] = {colSec[0], colSec[1], colSec[2], colSec[3]};
byte effectIn = effectCurrent;
byte speedIn = effectSpeed;
byte intensityIn = effectIntensity;
byte paletteIn = effectPalette;
bool singleSegment = false;
pos = req.indexOf(F("SS="));
@ -639,6 +631,16 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
selseg.setOption(SEG_OPTION_SELECTED, t);
}
//temporary values, do not write direcly to global values if only setting a single segment
uint32_t col0 = selseg.colors[0];
uint32_t col1 = selseg.colors[1];
byte colIn[4] = {R(col0), G(col0), B(col0), W(col0)};
byte colInSec[4] = {R(col1), G(col1), B(col1), W(col1)};
byte effectIn = selseg.mode;
byte speedIn = selseg.speed;
byte intensityIn = selseg.intensity;
byte paletteIn = selseg.palette;
uint16_t startI = selseg.start;
uint16_t stopI = selseg.stop;
uint8_t grpI = selseg.grouping;

View File

@ -198,7 +198,7 @@ void initServer()
{
serveMessage(request, 500, F("Failed updating firmware!"), F("Please check your file and retry!"), 254); return;
}
serveMessage(request, 200, F("Successfully updated firmware!"), F("Please wait while the module reboots..."), 131);
serveMessage(request, 200, F("Successfully updated firmware!"), F("Rebooting..."), 131);
doReboot = true;
},[](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){
if(!index){