Added new HTTP API commands (resolves #597)
This commit is contained in:
parent
569efd3e45
commit
125e21900a
@ -90,7 +90,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//version code in format yymmddb (b = daily build)
|
//version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2001151
|
#define VERSION 2001191
|
||||||
|
|
||||||
char versionString[] = "0.9.0-b2";
|
char versionString[] = "0.9.0-b2";
|
||||||
|
|
||||||
|
@ -53,7 +53,9 @@ char* XML_response(AsyncWebServerRequest *request, char* dest = nullptr)
|
|||||||
}
|
}
|
||||||
oappend("</wv><ws>");
|
oappend("</wv><ws>");
|
||||||
oappendi(colSec[3]);
|
oappendi(colSec[3]);
|
||||||
oappend("</ws><cy>");
|
oappend("</ws><ps>");
|
||||||
|
oappendi((currentPreset < 1) ? 0:currentPreset);
|
||||||
|
oappend("</ps><cy>");
|
||||||
oappendi(presetCyclingEnabled);
|
oappendi(presetCyclingEnabled);
|
||||||
oappend("</cy><ds>");
|
oappend("</cy><ds>");
|
||||||
if (realtimeActive)
|
if (realtimeActive)
|
||||||
|
@ -377,11 +377,14 @@ bool handleSet(AsyncWebServerRequest *request, const String& req)
|
|||||||
if (t < strip.getMaxSegments()) main = t;
|
if (t < strip.getMaxSegments()) main = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WS2812FX::Segment& mainseg = strip.getSegment(main);
|
||||||
pos = req.indexOf("SV="); //segment selected
|
pos = req.indexOf("SV="); //segment selected
|
||||||
if (pos > 0) strip.getSegment(main).setOption(0, (req.charAt(pos+3) != '0'));
|
if (pos > 0) mainseg.setOption(0, (req.charAt(pos+3) != '0'));
|
||||||
|
|
||||||
uint16_t startI = strip.getSegment(main).start;
|
uint16_t startI = mainseg.start;
|
||||||
uint16_t stopI = strip.getSegment(main).stop;
|
uint16_t stopI = mainseg.stop;
|
||||||
|
uint8_t grpI = mainseg.grouping;
|
||||||
|
uint16_t spcI = mainseg.spacing;
|
||||||
pos = req.indexOf("&S="); //segment start
|
pos = req.indexOf("&S="); //segment start
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
startI = getNumVal(&req, pos);
|
startI = getNumVal(&req, pos);
|
||||||
@ -390,7 +393,16 @@ bool handleSet(AsyncWebServerRequest *request, const String& req)
|
|||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
stopI = getNumVal(&req, pos);
|
stopI = getNumVal(&req, pos);
|
||||||
}
|
}
|
||||||
strip.setSegment(main, startI, stopI);
|
pos = req.indexOf("GP="); //segment grouping
|
||||||
|
if (pos > 0) {
|
||||||
|
grpI = getNumVal(&req, pos);
|
||||||
|
if (grpI == 0) grpI = 1;
|
||||||
|
}
|
||||||
|
pos = req.indexOf("SP="); //segment spacing
|
||||||
|
if (pos > 0) {
|
||||||
|
spcI = getNumVal(&req, pos);
|
||||||
|
}
|
||||||
|
strip.setSegment(main, startI, stopI, grpI, spcI);
|
||||||
|
|
||||||
main = strip.getMainSegmentId();
|
main = strip.getMainSegmentId();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user