Skip to content

Commit

Permalink
Added SV=2 to HTTP API, allow selecting single segment only
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Jun 26, 2020
1 parent 5464cbc commit 10a1275
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### Development versions after 0.10.0 release

#### Build 2006251

- Added `SV=2` to HTTP API, allow selecting single segment only

#### Build 2006250

- Fix Alexa not turning off white channel (fixes #1012)
Expand Down
11 changes: 10 additions & 1 deletion wled00/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,16 @@ bool handleSet(AsyncWebServerRequest *request, const String& req)

WS2812FX::Segment& mainseg = strip.getSegment(main);
pos = req.indexOf("SV="); //segment selected
if (pos > 0) mainseg.setOption(SEG_OPTION_SELECTED, (req.charAt(pos+3) != '0'));
if (pos > 0) {
byte t = getNumVal(&req, pos);
if (t == 2) {
for (uint8_t i = 0; i < strip.getMaxSegments(); i++)
{
strip.getSegment(i).setOption(SEG_OPTION_SELECTED, 0);
}
}
mainseg.setOption(SEG_OPTION_SELECTED, t);
}

uint16_t startI = mainseg.start;
uint16_t stopI = mainseg.stop;
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// version code in format yymmddb (b = daily build)
#define VERSION 2006250
#define VERSION 2006251

// ESP8266-01 (blue) got too little storage space to work with all features of WLED. To use it, you must use ESP8266 Arduino Core v2.4.2 and the setting 512K(No SPIFFS).

Expand Down

0 comments on commit 10a1275

Please sign in to comment.