Skip to content

Commit 3a3948e

Browse files
committed
Release of WLED v0.11.0
1 parent c01dd23 commit 3a3948e

File tree

5 files changed

+35
-20
lines changed

5 files changed

+35
-20
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
### WLED version 0.11.0
44

5+
#### Build 2011290
6+
7+
- Release of WLED 0.11.0 "Mirai"
8+
- Workaround for weird empty %f Espalexa issue
9+
- Fixed crash on saving preset with HTTP API `PS`
10+
- Improved performance for color changes in non-main segment
11+
512
#### Build 2011270
613

714
- Added tooltips for speed and intensity sliders (PR #1378)

wled00/json.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void deserializeSegment(JsonObject elem, byte it)
6868
if (i == 1) {colSec[0] = rgbw[0]; colSec[1] = rgbw[1]; colSec[2] = rgbw[2]; colSec[3] = rgbw[3];}
6969
} else { //normal case, apply directly to segment (=> no transition!)
7070
seg.colors[i] = ((rgbw[3] << 24) | ((rgbw[0]&0xFF) << 16) | ((rgbw[1]&0xFF) << 8) | ((rgbw[2]&0xFF)));
71+
if (seg.mode == FX_MODE_STATIC) strip.trigger(); //instant refresh
7172
}
7273
}
7374
}

wled00/presets.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,37 @@ bool applyPreset(byte index)
3737
void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj)
3838
{
3939
if (index == 0 || index > 250) return;
40-
bool docAlloc = fileDoc;
40+
bool docAlloc = (fileDoc != nullptr);
4141
JsonObject sObj = saveobj;
4242

4343
if (!docAlloc) {
4444
DEBUGFS_PRINTLN(F("Allocating saving buffer"));
45-
fileDoc = new DynamicJsonDocument(JSON_BUFFER_SIZE);
46-
sObj = fileDoc->to<JsonObject>();
45+
DynamicJsonDocument lDoc(JSON_BUFFER_SIZE);
46+
sObj = lDoc.to<JsonObject>();
4747
if (pname) sObj["n"] = pname;
48-
} else {
48+
DEBUGFS_PRINTLN(F("Save current state"));
49+
serializeState(sObj, true);
50+
currentPreset = index;
51+
52+
writeObjectToFileUsingId("/presets.json", index, &lDoc);
53+
} else { //from JSON API
4954
DEBUGFS_PRINTLN(F("Reuse recv buffer"));
5055
sObj.remove(F("psave"));
5156
sObj.remove(F("v"));
52-
}
5357

54-
if (!sObj["o"]) {
55-
DEBUGFS_PRINTLN(F("Save current state"));
56-
serializeState(sObj, true, sObj["ib"], sObj["sb"]);
57-
currentPreset = index;
58-
}
59-
sObj.remove("o");
60-
sObj.remove("ib");
61-
sObj.remove("sb");
62-
sObj.remove(F("error"));
63-
sObj.remove(F("time"));
58+
if (!sObj["o"]) {
59+
DEBUGFS_PRINTLN(F("Save current state"));
60+
serializeState(sObj, true, sObj["ib"], sObj["sb"]);
61+
currentPreset = index;
62+
}
63+
sObj.remove("o");
64+
sObj.remove("ib");
65+
sObj.remove("sb");
66+
sObj.remove(F("error"));
67+
sObj.remove(F("time"));
6468

65-
writeObjectToFileUsingId("/presets.json", index, fileDoc);
66-
if (!docAlloc) delete fileDoc;
69+
writeObjectToFileUsingId("/presets.json", index, fileDoc);
70+
}
6771
presetsModifiedTime = now(); //unix time
6872
updateFSInfo();
6973
}

wled00/src/dependencies/espalexa/Espalexa.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,11 @@ class Espalexa {
144144
char buf_col[80] = "";
145145
//color support
146146
if (static_cast<uint8_t>(dev->getType()) > 2)
147-
sprintf_P(buf_col,PSTR(",\"hue\":%u,\"sat\":%u,\"effect\":\"none\",\"xy\":[%f,%f]")
148-
,dev->getHue(), dev->getSat(), dev->getX(), dev->getY());
147+
//TODO: %f is not working for some reason on ESP8266 in v0.11.0 (was fine in 0.10.2). Need to investigate
148+
//sprintf_P(buf_col,PSTR(",\"hue\":%u,\"sat\":%u,\"effect\":\"none\",\"xy\":[%f,%f]")
149+
// ,dev->getHue(), dev->getSat(), dev->getX(), dev->getY());
150+
sprintf_P(buf_col,PSTR(",\"hue\":%u,\"sat\":%u,\"effect\":\"none\",\"xy\":[%s,%s]"),dev->getHue(), dev->getSat(),
151+
((String)dev->getX()).c_str(), ((String)dev->getY()).c_str());
149152

150153
char buf_ct[16] = "";
151154
//white spectrum support

wled00/wled.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
// version code in format yymmddb (b = daily build)
11-
#define VERSION 2011270
11+
#define VERSION 2011290
1212

1313
//uncomment this if you have a "my_config.h" file you'd like to use
1414
//#define WLED_USE_MY_CONFIG

0 commit comments

Comments
 (0)