From 1270f2d577f0534e5c6b6489237719ad7d256a55 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Fri, 17 Dec 2021 20:33:48 +0100 Subject: [PATCH 01/37] Sync segment options. Freeze effect. Repeat last segment until end. --- wled00/cfg.cpp | 4 +- wled00/data/index.css | 7 +- wled00/data/index.htm | 2 +- wled00/data/index.js | 20 +- wled00/data/settings_sync.htm | 32 +- wled00/html_settings.h | 56 +- wled00/html_ui.h | 4363 +++++++++++++++++---------------- wled00/json.cpp | 34 +- wled00/led.cpp | 2 +- wled00/set.cpp | 5 +- wled00/udp.cpp | 30 +- wled00/wled.h | 1 + wled00/xml.cpp | 1 + 13 files changed, 2317 insertions(+), 2240 deletions(-) diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index c4fdbde6..f89dae83 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -239,8 +239,9 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { CJSON(receiveNotificationColor, if_sync_recv["col"]); CJSON(receiveNotificationEffects, if_sync_recv["fx"]); CJSON(receiveGroups, if_sync_recv["grp"]); + CJSON(receiveSegmentOptions, if_sync_recv["seg"]); //! following line might be a problem if called after boot - receiveNotifications = (receiveNotificationBrightness || receiveNotificationColor || receiveNotificationEffects); + receiveNotifications = (receiveNotificationBrightness || receiveNotificationColor || receiveNotificationEffects || receiveSegmentOptions); JsonObject if_sync_send = if_sync["send"]; prev = notifyDirectDefault; @@ -628,6 +629,7 @@ void serializeConfig() { if_sync_recv["col"] = receiveNotificationColor; if_sync_recv["fx"] = receiveNotificationEffects; if_sync_recv["grp"] = receiveGroups; + if_sync_recv["seg"] = receiveSegmentOptions; JsonObject if_sync_send = if_sync.createNestedObject("send"); if_sync_send[F("dir")] = notifyDirect; diff --git a/wled00/data/index.css b/wled00/data/index.css index a7588ddb..fe7f5582 100644 --- a/wled00/data/index.css +++ b/wled00/data/index.css @@ -609,11 +609,12 @@ input[type=range]:active + .sliderbubble { width: 216px; } .btn-xs { - width: 39px; + width: 42px; + height: 42px; margin: 2px 0 0 0; } .btn-pl-add { - margin-left: 9px; + margin-left: 5px; } @@ -645,7 +646,7 @@ input[type=range]:active + .sliderbubble { .sel-pl { width: 192px; background-position: 168px 16px; - margin: 8px 7px 0 0; + margin: 8px 3px 0 0; } .sel-ple { diff --git a/wled00/data/index.htm b/wled00/data/index.htm index 25787aa3..6ec6d5bf 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -141,7 +141,7 @@

Effect speed

- +
diff --git a/wled00/data/index.js b/wled00/data/index.js index 806315ae..78736173 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -603,7 +603,6 @@ function populateSegments(s)
- +
+ + +

`; } @@ -627,10 +630,12 @@ function populateSegments(s) noNewSegs = false; } for (var i = 0; i <= lSeg; i++) { - updateLen(i); - updateTrail(d.getElementById(`seg${i}bri`)); - if (segCount < 2) d.getElementById(`segd${lSeg}`).style.display = "none"; + updateLen(i); + updateTrail(d.getElementById(`seg${i}bri`)); + d.getElementById(`segr${i}`).style.display = "none"; } + if (segCount < 2) d.getElementById(`segd${lSeg}`).style.display = "none"; + if (!noNewSegs && (cfg.comp.seglen?parseInt(d.getElementById(`seg${lSeg}s`).value):0)+parseInt(d.getElementById(`seg${lSeg}e`).value) 1) ? "inline":"none"; } @@ -1542,6 +1547,13 @@ function setSegBri(s){ requestJson(obj); } +function tglFreeze(s=null) +{ + var obj = {"seg": {"frz": "t"}}; // toggle + if (s!==null) obj.id = s; + requestJson(obj); +} + function setX(ind = null) { if (ind === null) { ind = parseInt(d.querySelector('#fxlist input[name="fx"]:checked').value); diff --git a/wled00/data/settings_sync.htm b/wled00/data/settings_sync.htm index cb0e5b1c..1baf9e51 100644 --- a/wled00/data/settings_sync.htm +++ b/wled00/data/settings_sync.htm @@ -5,7 +5,8 @@ function gId(s) { return d.getElementById(s); } -function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#sync-settings");}function B(){window.open("/settings","_self");} +function H(){window.open("https://kno.wled.ge/interfaces/udp-notifier/");} +function B(){window.open("/settings","_self");} function adj(){if (d.Sf.DI.value == 6454) {if (d.Sf.DA.value == 1) d.Sf.DA.value = 0; if (d.Sf.EU.value == 1) d.Sf.EU.value = 0;} else if (d.Sf.DI.value == 5568) {if (d.Sf.DA.value == 0) d.Sf.DA.value = 1; if (d.Sf.EU.value == 0) d.Sf.EU.value = 1;} } function FC() @@ -82,6 +83,7 @@ UDP Port:
Receive: Brightness, Color, and Effects
+Segment options
Send notifications on direct change:
Send notifications on button press or IR:
Send Alexa notifications:
@@ -117,45 +119,45 @@ DMX mode:
-E1.31 info
+E1.31 info
Timeout: ms
Force max brightness:
Disable realtime gamma correction:
Realtime LED offset:

Alexa Voice Assistant

Emulate Alexa device:
-Alexa invocation name: +Alexa invocation name:

Blynk

Blynk, MQTT and Hue sync all connect to external hosts!
This may impact the responsiveness of the ESP8266.

For best results, only use one of these services at a time.
(alternatively, connect a second ESP to them and use the UDP sync)

-Host: +Host: Port:
Device Auth token:
-Clear the token field to disable. Setup info +Clear the token field to disable. Setup info

MQTT

Enable MQTT:
-Broker: +Broker: Port:
The MQTT credentials are sent over an unsecured connection.
Never use the MQTT password for another service!

-Username:
+Username:
Password:
-Client ID:
-Device Topic:
-Group Topic:
+Client ID:
+Device Topic:
+Group Topic:
Publish on button press:
-Reboot required to apply changes. MQTT info +Reboot required to apply changes. MQTT info

Philips Hue

You can find the bridge IP and the light number in the 'About' section of the hue app.
Poll Hue light every ms:
Then, receive On/Off, Brightness, and Color
Hue Bridge IP:
- . - . - . -
+ . + . + . +
Press the pushlink button on the bridge, after that save this page!
(when first connecting)
Hue status: Disabled in this build
diff --git a/wled00/html_settings.h b/wled00/html_settings.h index c3e7d1da..06585bee 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -244,7 +244,7 @@ type="button" onclick="Save()">Save)====="; // Autogenerated from wled00/data/settings_sync.htm, do not edit!! const char PAGE_settings_sync[] PROGMEM = R"=====( Sync Settings