Skip to content

Commit

Permalink
Release of WLED v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Nov 29, 2020
1 parent c01dd23 commit 3a3948e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

### WLED version 0.11.0

#### Build 2011290

- Release of WLED 0.11.0 "Mirai"
- Workaround for weird empty %f Espalexa issue
- Fixed crash on saving preset with HTTP API `PS`
- Improved performance for color changes in non-main segment

#### Build 2011270

- Added tooltips for speed and intensity sliders (PR #1378)
Expand Down
1 change: 1 addition & 0 deletions wled00/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void deserializeSegment(JsonObject elem, byte it)
if (i == 1) {colSec[0] = rgbw[0]; colSec[1] = rgbw[1]; colSec[2] = rgbw[2]; colSec[3] = rgbw[3];}
} else { //normal case, apply directly to segment (=> no transition!)
seg.colors[i] = ((rgbw[3] << 24) | ((rgbw[0]&0xFF) << 16) | ((rgbw[1]&0xFF) << 8) | ((rgbw[2]&0xFF)));
if (seg.mode == FX_MODE_STATIC) strip.trigger(); //instant refresh
}
}
}
Expand Down
38 changes: 21 additions & 17 deletions wled00/presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,37 @@ bool applyPreset(byte index)
void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj)
{
if (index == 0 || index > 250) return;
bool docAlloc = fileDoc;
bool docAlloc = (fileDoc != nullptr);
JsonObject sObj = saveobj;

if (!docAlloc) {
DEBUGFS_PRINTLN(F("Allocating saving buffer"));
fileDoc = new DynamicJsonDocument(JSON_BUFFER_SIZE);
sObj = fileDoc->to<JsonObject>();
DynamicJsonDocument lDoc(JSON_BUFFER_SIZE);
sObj = lDoc.to<JsonObject>();
if (pname) sObj["n"] = pname;
} else {
DEBUGFS_PRINTLN(F("Save current state"));
serializeState(sObj, true);
currentPreset = index;

writeObjectToFileUsingId("/presets.json", index, &lDoc);
} else { //from JSON API
DEBUGFS_PRINTLN(F("Reuse recv buffer"));
sObj.remove(F("psave"));
sObj.remove(F("v"));
}

if (!sObj["o"]) {
DEBUGFS_PRINTLN(F("Save current state"));
serializeState(sObj, true, sObj["ib"], sObj["sb"]);
currentPreset = index;
}
sObj.remove("o");
sObj.remove("ib");
sObj.remove("sb");
sObj.remove(F("error"));
sObj.remove(F("time"));
if (!sObj["o"]) {
DEBUGFS_PRINTLN(F("Save current state"));
serializeState(sObj, true, sObj["ib"], sObj["sb"]);
currentPreset = index;
}
sObj.remove("o");
sObj.remove("ib");
sObj.remove("sb");
sObj.remove(F("error"));
sObj.remove(F("time"));

writeObjectToFileUsingId("/presets.json", index, fileDoc);
if (!docAlloc) delete fileDoc;
writeObjectToFileUsingId("/presets.json", index, fileDoc);
}
presetsModifiedTime = now(); //unix time
updateFSInfo();
}
Expand Down
7 changes: 5 additions & 2 deletions wled00/src/dependencies/espalexa/Espalexa.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ class Espalexa {
char buf_col[80] = "";
//color support
if (static_cast<uint8_t>(dev->getType()) > 2)
sprintf_P(buf_col,PSTR(",\"hue\":%u,\"sat\":%u,\"effect\":\"none\",\"xy\":[%f,%f]")
,dev->getHue(), dev->getSat(), dev->getX(), dev->getY());
//TODO: %f is not working for some reason on ESP8266 in v0.11.0 (was fine in 0.10.2). Need to investigate
//sprintf_P(buf_col,PSTR(",\"hue\":%u,\"sat\":%u,\"effect\":\"none\",\"xy\":[%f,%f]")
// ,dev->getHue(), dev->getSat(), dev->getX(), dev->getY());
sprintf_P(buf_col,PSTR(",\"hue\":%u,\"sat\":%u,\"effect\":\"none\",\"xy\":[%s,%s]"),dev->getHue(), dev->getSat(),
((String)dev->getX()).c_str(), ((String)dev->getY()).c_str());

char buf_ct[16] = "";
//white spectrum support
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 2011270
#define VERSION 2011290

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

0 comments on commit 3a3948e

Please sign in to comment.