From b97b6dc144207bce7d41392c0c198b25c59f3558 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Tue, 23 Nov 2021 13:17:33 +0100 Subject: [PATCH 1/4] Remove F macro for "ps" --- wled00/cfg.cpp | 4 ++-- wled00/json.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 20bcdbd8..a72af85b 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -220,7 +220,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { CJSON(macroNl, light_nl["macro"]); JsonObject def = doc[F("def")]; - CJSON(bootPreset, def[F("ps")]); + CJSON(bootPreset, def["ps"]); CJSON(turnOnAtBoot, def["on"]); // true CJSON(briS, def["bri"]); // 128 @@ -593,7 +593,7 @@ void serializeConfig() { light_nl["macro"] = macroNl; JsonObject def = doc.createNestedObject("def"); - def[F("ps")] = bootPreset; + def["ps"] = bootPreset; def["on"] = turnOnAtBoot; def["bri"] = briS; diff --git a/wled00/json.cpp b/wled00/json.cpp index de40f561..1a546c79 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -429,7 +429,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme if (!forPreset) { if (errorFlag) root[F("error")] = errorFlag; - root[F("ps")] = (currentPreset > 0) ? currentPreset : -1; + root["ps"] = (currentPreset > 0) ? currentPreset : -1; root[F("pl")] = currentPlaylist; usermods.addToJsonState(root); From 97b3c3db7b26b766cf4860336c2b9384876627e0 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Tue, 23 Nov 2021 20:05:51 +0100 Subject: [PATCH 2/4] Incrementing & random effects, palettes via JSON. --- wled00/json.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wled00/json.cpp b/wled00/json.cpp index 1a546c79..a30aa68b 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -148,21 +148,21 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId) //temporary, strip object gets updated via colorUpdated() if (id == strip.getMainSegmentId()) { - byte effectPrev = effectCurrent; - effectCurrent = elem["fx"] | effectCurrent; - if (!presetId && effectCurrent != effectPrev) unloadPlaylist(); //stop playlist if active and FX changed manually + if (getVal(elem["fx"], &effectCurrent, 1, strip.getModeCount())) { //load effect ('r' random, '~' inc/dec, 1-255 exact value) + if (!presetId) unloadPlaylist(); //stop playlist if active and FX changed manually + } effectSpeed = elem[F("sx")] | effectSpeed; effectIntensity = elem[F("ix")] | effectIntensity; - effectPalette = elem["pal"] | effectPalette; + getVal(elem["pal"], &effectPalette, 1, strip.getPaletteCount()); } else { //permanent - byte fx = elem["fx"] | seg.mode; - if (fx != seg.mode && fx < strip.getModeCount()) { + byte fx = seg.mode; + if (getVal(elem["fx"], &fx, 1, strip.getModeCount())) { //load effect ('r' random, '~' inc/dec, 1-255 exact value) strip.setMode(id, fx); if (!presetId) unloadPlaylist(); //stop playlist if active and FX changed manually } seg.speed = elem[F("sx")] | seg.speed; seg.intensity = elem[F("ix")] | seg.intensity; - seg.palette = elem["pal"] | seg.palette; + getVal(elem["pal"], &seg.palette, 1, strip.getPaletteCount()); } JsonArray iarr = elem[F("i")]; //set individual LEDs From 37bd525638b5926e175409265a8b0b3a19993402 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Wed, 24 Nov 2021 11:04:50 +0100 Subject: [PATCH 3/4] Improve link contrast --- wled00/data/style.css | 4 ++++ wled00/html_settings.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wled00/data/style.css b/wled00/data/style.css index 06c2e8a3..0f0370f0 100644 --- a/wled00/data/style.css +++ b/wled00/data/style.css @@ -9,6 +9,10 @@ body { hr { border-color: #666; } +a { + color: #58a6ff; + text-decoration: none; +} button, .btn { background: #333; color: #fff; diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 6326886c..1516883f 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -6,7 +6,7 @@ */ // Autogenerated from wled00/data/style.css, do not edit!! -const char PAGE_settingsCss[] PROGMEM = R"=====()====="; +const char PAGE_settingsCss[] PROGMEM = R"=====()====="; // Autogenerated from wled00/data/settings.htm, do not edit!! From 02fb2550d0d7459563cd927857935df65c0a3e57 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Wed, 24 Nov 2021 12:38:54 +0100 Subject: [PATCH 4/4] Shorter link color --- wled00/data/style.css | 2 +- wled00/html_settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/data/style.css b/wled00/data/style.css index 0f0370f0..879b19b3 100644 --- a/wled00/data/style.css +++ b/wled00/data/style.css @@ -10,7 +10,7 @@ hr { border-color: #666; } a { - color: #58a6ff; + color: #28f; text-decoration: none; } button, .btn { diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 1516883f..3a6406b5 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -6,7 +6,7 @@ */ // Autogenerated from wled00/data/style.css, do not edit!! -const char PAGE_settingsCss[] PROGMEM = R"=====()====="; +const char PAGE_settingsCss[] PROGMEM = R"=====()====="; // Autogenerated from wled00/data/settings.htm, do not edit!!