Skip to content

Commit 96422de

Browse files
committed
0.13.0-b3
1 parent f2043dc commit 96422de

File tree

13 files changed

+811
-796
lines changed

13 files changed

+811
-796
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
### Builds after release 0.12.0
44

5-
#### Build 2109200
5+
#### Build 2109220
66

7+
- Version bump to 0.13.0-b3 "Toki"
78
- Added segment names (PR #2184)
89
- Improved Police and other effects (PR #2184)
910
- Reverted PR #1902 (Live color correction - will be implemented as usermod) (PR #2175)
11+
- Added transitions for segment on/off
12+
- Improved number of sparks/stars in Fireworks effect with low number of segments
13+
- Fixed segment name edit pencil disappearing with request
14+
- Fixed color transition active even if the segment is off
15+
- Disallowed file upload with OTA lock active
16+
- Fixed analog invert option missing (PR #2219)
1017

1118
#### Build 2109100
1219

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wled",
3-
"version": "0.13.0-b2",
3+
"version": "0.13.0-b3",
44
"description": "Tools for WLED project",
55
"main": "tools/cdata.js",
66
"directories": {

wled00/FX.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,22 @@ class WS2812FX {
279279
void setOption(uint8_t n, bool val, uint8_t segn = 255)
280280
{
281281
bool prevOn = false;
282-
if (n == SEG_OPTION_ON) prevOn = getOption(SEG_OPTION_ON);
282+
if (n == SEG_OPTION_ON) {
283+
prevOn = getOption(SEG_OPTION_ON);
284+
if (!val && prevOn) { //fade off
285+
ColorTransition::startTransition(opacity, colors[0], instance->_transitionDur, segn, 0);
286+
}
287+
}
288+
283289
if (val) {
284290
options |= 0x01 << n;
285291
} else
286292
{
287293
options &= ~(0x01 << n);
288294
}
289-
//transitions on segment on/off don't work correctly at this point
290-
if (n == SEG_OPTION_ON && segn < MAX_NUM_SEGMENTS && val != prevOn) {
291-
if (val) {
292-
ColorTransition::startTransition(0, colors[0], instance->_transitionDur, segn, 0);
293-
} else {
294-
ColorTransition::startTransition(opacity, colors[0], instance->_transitionDur, segn, 0);
295-
}
295+
296+
if (n == SEG_OPTION_ON && val && !prevOn) { //fade on
297+
ColorTransition::startTransition(0, colors[0], instance->_transitionDur, segn, 0);
296298
}
297299
}
298300
bool getOption(uint8_t n)
@@ -413,6 +415,7 @@ class WS2812FX {
413415
static void startTransition(uint8_t oldBri, uint32_t oldCol, uint16_t dur, uint8_t segn, uint8_t slot) {
414416
if (segn >= MAX_NUM_SEGMENTS || slot >= NUM_COLORS || dur == 0) return;
415417
if (instance->_brightness == 0) return; //do not need transitions if master bri is off
418+
if (!instance->_segments[segn].getOption(SEG_OPTION_ON)) return; //not if segment is off either
416419
uint8_t tIndex = 0xFF; //none found
417420
uint16_t tProgression = 0;
418421
uint8_t s = segn + (slot << 6); //merge slot and segment into one byte
@@ -441,7 +444,8 @@ class WS2812FX {
441444
ColorTransition& t = instance->transitions[tIndex];
442445
if (t.segment == s) //this is an active transition on the same segment+color
443446
{
444-
t.briOld = t.currentBri();
447+
bool wasTurningOff = (oldBri == 0);
448+
t.briOld = t.currentBri(wasTurningOff);
445449
t.colorOld = t.currentColor(oldCol);
446450
} else {
447451
t.briOld = oldBri;
@@ -473,11 +477,11 @@ class WS2812FX {
473477
uint32_t currentColor(uint32_t colorNew) {
474478
return instance->color_blend(colorOld, colorNew, progress(true), true);
475479
}
476-
uint8_t currentBri() {
480+
uint8_t currentBri(bool turningOff = false) {
477481
uint8_t segn = segment & 0x3F;
478482
if (segn >= MAX_NUM_SEGMENTS) return 0;
479483
uint8_t briNew = instance->_segments[segn].opacity;
480-
if (!instance->_segments[segn].getOption(SEG_OPTION_ON)) briNew = 0; //NEW
484+
if (!instance->_segments[segn].getOption(SEG_OPTION_ON) || turningOff) briNew = 0;
481485
uint32_t prog = progress() + 1;
482486
return ((briNew * prog) + (briOld * (0x10000 - prog))) >> 16;
483487
}

wled00/data/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ function populateSegments(s)
580580
</label>
581581
<div class="segname">
582582
<div class="segntxt" onclick="selSegEx(${i})">${inst.n ? inst.n : "Segment "+i}</div>
583-
<i class="icons edit-icon" id="seg${i}nedit" onclick="tglSegn(${i})">&#xe2c6;</i>
583+
<i class="icons edit-icon ${expanded[i] ? "expanded":""}" id="seg${i}nedit" onclick="tglSegn(${i})">&#xe2c6;</i>
584584
</div>
585585
<i class="icons e-icon flr ${expanded[i] ? "exp":""}" id="sege${i}" onclick="expand(${i})">&#xe395;</i>
586586
<div class="segin ${expanded[i] ? "expanded":""}" id="seg${i}">
@@ -1260,7 +1260,7 @@ function makeSeg() {
12601260
var cn = `<div class="seg">
12611261
<div class="segname newseg">
12621262
New segment ${lowestUnused}
1263-
<i class="icons edit-icon" style="display: inline;" onclick="tglSegn(${lowestUnused})">&#xe2c6;</i>
1263+
<i class="icons edit-icon expanded" onclick="tglSegn(${lowestUnused})">&#xe2c6;</i>
12641264
</div>
12651265
<br>
12661266
<div class="segin expanded">

wled00/data/settings_leds.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
}
309309
function uploadFile(name) {
310310
var req = new XMLHttpRequest();
311-
req.addEventListener('load', function(){showToast(this.responseText)});
311+
req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)});
312312
req.addEventListener('error', function(e){showToast(e.stack,true);});
313313
req.open("POST", "/upload");
314314
var formData = new FormData();

wled00/data/settings_sec.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
function uploadFile(fO,name) {
3939
var req = new XMLHttpRequest();
40-
req.addEventListener('load', function(){showToast(this.responseText)});
40+
req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)});
4141
req.addEventListener('error', function(e){showToast(e.stack,true);});
4242
req.open("POST", "/upload");
4343
var formData = new FormData();

wled00/data/settings_ui.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
}
194194
function uploadFile(fO,name) {
195195
var req = new XMLHttpRequest();
196-
req.addEventListener('load', function(){showToast(this.responseText)});
196+
req.addEventListener('load', function(){showToast(this.responseText,this.status >= 400)});
197197
req.addEventListener('error', function(e){showToast(e.stack,true);});
198198
req.open("POST", "/upload");
199199
var formData = new FormData();

wled00/html_other.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function B(){window.history.back()}function U(){document.getElementById("uf").st
4242
.bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}#msg{display:none}
4343
</style></head><body><h2>WLED Software Update</h2><form method="POST"
4444
action="/update" id="uf" enctype="multipart/form-data" onsubmit="U()">
45-
Installed version: 0.13.0-b2<br>Download the latest binary: <a
45+
Installed version: 0.13.0-b3<br>Download the latest binary: <a
4646
href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img
4747
src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square">
4848
</a><br><input type="file" class="bt" name="update" required><br><input

wled00/html_settings.h

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)