Merge pull request #2665 from Stoom/segment_bri_fix

🐛 fix(json): allow for using `~-16` or `~16` when setting a segments brightness though the JSON api
This commit is contained in:
Blaž Kristan 2022-05-29 11:02:59 +02:00 committed by GitHub
commit 19c8b4fe2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,7 +95,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
if (stop > start && of > len -1) of = len -1;
strip.setSegment(id, start, stop, grp, spc, of);
byte segbri = 0;
byte segbri = seg.opacity;
if (getVal(elem["bri"], &segbri)) {
if (segbri > 0) seg.setOpacity(segbri, id);
seg.setOption(SEG_OPTION_ON, segbri, id);