Merge branch '0_14' of https://github.com/aircoookie/WLED into dev
This commit is contained in:
commit
4d939cb778
@ -1136,7 +1136,7 @@ void WS2812FX::setColor(uint8_t slot, uint32_t c) {
|
|||||||
if (slot >= NUM_COLORS) return;
|
if (slot >= NUM_COLORS) return;
|
||||||
|
|
||||||
for (segment &seg : _segments) {
|
for (segment &seg : _segments) {
|
||||||
if (seg.isSelected()) {
|
if (seg.isActive() && seg.isSelected()) {
|
||||||
seg.setColor(slot, c);
|
seg.setColor(slot, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1172,7 +1172,7 @@ uint8_t WS2812FX::getFirstSelectedSegId(void)
|
|||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for (segment &seg : _segments) {
|
for (segment &seg : _segments) {
|
||||||
if (seg.isSelected()) return i;
|
if (seg.isActive() && seg.isSelected()) return i;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// if none selected, use the main segment
|
// if none selected, use the main segment
|
||||||
|
@ -426,11 +426,14 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
|||||||
} else if (root["win"].isNull() && getVal(root["ps"], &ps, 0, 0) && ps > 0 && ps < 251 && ps != currentPreset) {
|
} else if (root["win"].isNull() && getVal(root["ps"], &ps, 0, 0) && ps > 0 && ps < 251 && ps != currentPreset) {
|
||||||
// b) preset ID only or preset that does not change state (use embedded cycling limits if they exist in getVal())
|
// b) preset ID only or preset that does not change state (use embedded cycling limits if they exist in getVal())
|
||||||
presetCycCurr = ps;
|
presetCycCurr = ps;
|
||||||
|
presetId = ps;
|
||||||
root.remove(F("v")); // may be added in UI call
|
root.remove(F("v")); // may be added in UI call
|
||||||
root.remove(F("time")); // may be added in UI call
|
root.remove(F("time")); // may be added in UI call
|
||||||
root.remove("ps");
|
root.remove("ps");
|
||||||
if (root.size() == 0) applyPreset(ps, callMode); // async load (only preset ID was specified)
|
if (root.size() == 0) {
|
||||||
return stateResponse;
|
applyPreset(ps, callMode); // async load (only preset ID was specified)
|
||||||
|
return stateResponse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,6 +583,8 @@ void serializeInfo(JsonObject root)
|
|||||||
leds["fps"] = strip.getFps();
|
leds["fps"] = strip.getFps();
|
||||||
leds[F("maxpwr")] = (strip.currentMilliamps)? strip.ablMilliampsMax : 0;
|
leds[F("maxpwr")] = (strip.currentMilliamps)? strip.ablMilliampsMax : 0;
|
||||||
leds[F("maxseg")] = strip.getMaxSegments();
|
leds[F("maxseg")] = strip.getMaxSegments();
|
||||||
|
//leds[F("actseg")] = strip.getActiveSegmentsNum();
|
||||||
|
//leds[F("seglock")] = false; //might be used in the future to prevent modifications to segment config
|
||||||
leds[F("cpal")] = strip.customPalettes.size(); //number of custom palettes
|
leds[F("cpal")] = strip.customPalettes.size(); //number of custom palettes
|
||||||
|
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
|
Loading…
Reference in New Issue
Block a user