From ca3c4bb12569e06d883792c7df519c4b9a3e9444 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sun, 7 May 2017 23:51:42 +0200 Subject: [PATCH] html update in progress notification receive and send buttons work settings iframe works implemented HSB partially --- readme.md | 5 +- wled00/data/button.png | Bin 2831 -> 0 bytes wled00/data/index.htm | 230 ++++++++++++++++++++++++++++------ wled00/data/moon.png | Bin 3703 -> 0 bytes wled00/data/settings.htm | 23 ++-- wled00/data/settingssaved.htm | 7 +- wled00/wled00.ino | 3 +- wled00/wled01_eeprom.ino | 3 + wled00/wled02_xml.ino | 19 +-- wled00/wled03_set.ino | 14 ++- 10 files changed, 234 insertions(+), 70 deletions(-) delete mode 100644 wled00/data/button.png delete mode 100644 wled00/data/moon.png diff --git a/readme.md b/readme.md index 1e3ff935..e2eaceec 100644 --- a/readme.md +++ b/readme.md @@ -62,9 +62,10 @@ Add one or multiple of the following parameters after the base url to change val "&T=<0 or 1 or 2-255>" 0: switch off, on, toggle "&FX=<0-47>" set LED effect (refer to WS2812FX library) "&SX=<0-255>" set LED effect speed (refer to WS2812FX library) -"&NR=<0 or 1>" receive notifications on or off -"&NS=<0 or 1>" send (direct) notifications on or off +"&RN=<0 or 1>" receive notifications on or off +"&SN=<0 or 1>" send (direct) notifications on or off "&NL=<0 or 1>" turns nightlight function on or off +"&MD=<0 or 1>" sets client color picker mode (RGB/HSB) ("&OL=<0, 1, 3 or 5>" experimental clock overlays) ("&I=<0-255>" experimental individual LED control) ("&I=<0-255>&I2=<0-255>" experimental individual LED range control) diff --git a/wled00/data/button.png b/wled00/data/button.png deleted file mode 100644 index bb80729bac0a4148b276837cdc1d70e41cd3fa16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2831 zcmYk8dpy(oAIHBlvmtW}JIuXY$~7hHM95t>E%)YjI+QM~;iS23rL@GU(864kOXw`6 zR$@C-kz1Tba>=NbOEH;4HT=G-e!s`>`*?i5pU?aCe7|4s_vic9m*$IgSCG?`0{}q5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rLrN|1a+A@nNBDv%l*nEG5}ZO<;OY(1_P0X{f&GCKzZpj)HuMLox?>{__S< z^0%OaegQ>1N#Q5F1Y~nm zkk>B-Na6ko&MD=Su0xp8D-KNUB&6ciK$*RDf1D4djz>bRQ${?P)Su2`4b I&Jkz+1N7f0lmGw# diff --git a/wled00/data/index.htm b/wled00/data/index.htm index d7ab40d1..18023213 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -7,7 +7,13 @@ strG = ""; strB = ""; strNL = ""; + strNR = ""; + strNS = ""; var nla = false; + var nra = false; + var nsa = false; + var sto = false; + var hsb = false; function Startup() { @@ -28,6 +34,8 @@ document.Ctrl_form.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue; document.Ctrl_form.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue; nla = (this.responseXML.getElementsByTagName('nl')[0].innerHTML)!=0?true:false; + nra = (this.responseXML.getElementsByTagName('nr')[0].innerHTML)!=0?true:false; + nsa = (this.responseXML.getElementsByTagName('ns')[0].innerHTML)!=0?true:false; document.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('desc')[0].innerHTML; UpdateVals(); } @@ -35,13 +43,15 @@ } } // send HTTP request - request.open("GET", "win/" + strA + strR + strG + strB + strNL + nocache, true); + request.open("GET", "win/" + strA + strR + strG + strB + strNL + strNR + strNS + nocache, true); request.send(null); strA = ""; strR = ""; strG = ""; strB = ""; strNL = ""; + strNR = ""; + strNS = ""; } function GetCheck() { @@ -63,15 +73,68 @@ function UpdateVals() { document.body.style.background = lingrad(Ctrl_form.SR.value, Ctrl_form.SG.value, Ctrl_form.SB.value); + setHS(Ctrl_form.SR.value, Ctrl_form.SG.value, Ctrl_form.SB.value); if (nla) { - nlb.style.fill="white"; + nlb.style.fill="green"; } else { nlb.style.fill="black"; } + if (nra) { + nrb.style.fill="green"; + } else { + nrb.style.fill="black"; + } + if (nsa) { + nsb.style.fill="green"; + } else { + nsb.style.fill="black"; + } + } + function ToggleHSB() + { + cdB.style.display="none"; + hsb = !hsb; + if (hsb) + { + document.getElementById("slR").style.display="none"; + document.getElementById("slG").style.display="none"; + document.getElementById("slB").style.display="none"; + document.getElementById("slH").style.display="block"; + document.getElementById("slS").style.display="block"; + mdb.style.fill="green"; + } else { + document.getElementById("slR").style.display="block"; + document.getElementById("slG").style.display="block"; + document.getElementById("slB").style.display="block"; + document.getElementById("slH").style.display="none"; + document.getElementById("slS").style.display="none"; + mdb.style.fill="black"; + } + cdB.style.display="inline"; } function OpenSettings() { - window.open("/settings","_self"); + sto = true; + stb.style.fill="green"; + cdB.style.display="none"; + stf.style.display="inline"; + stf.src="/settings"; + } + function CloseSettings() + { + sto = false; + stb.style.fill="black"; + cdB.style.display="inline"; + stf.style.display="none"; + } + function ToggleSettings() + { + if (sto) + { + CloseSettings(); + } else { + OpenSettings(); + } } function ToggleNl() { @@ -84,14 +147,88 @@ UpdateVals(); GetArduinoIO(); } + function ToggleNr() + { + nra = !nra; + if (nra) { + strNR="&RN=1"; + } else { + strNR="&RN=0"; + } + UpdateVals(); + GetArduinoIO(); + } + function ToggleNs() + { + nsa = !nsa; + if (nsa) { + strNS="&SN=1"; + } else { + strNS="&SN=0"; + } + UpdateVals(); + GetArduinoIO(); + } + function setHS() { + var rr, gg, bb, + r = arguments[0] / 255, + g = arguments[1] / 255, + b = arguments[2] / 255, + h, s, + v = Math.max(r, g, b), + diff = v - Math.min(r, g, b), + diffc = function(c){ + return (v - c) / 6 / diff + 1 / 2; + }; + + if (diff == 0) { + h = s = 0; + } else { + s = diff / v; + rr = diffc(r); + gg = diffc(g); + bb = diffc(b); + + if (r === v) { + h = bb - gg; + }else if (g === v) { + h = (1 / 3) + rr - bb; + }else if (b === v) { + h = (2 / 3) + gg - rr; + } + if (h < 0) { + h += 1; + }else if (h > 1) { + h -= 1; + } + } + document.Ctrl_form.SH.value = h; + document.Ctrl_form.SS.value = s; + } + function GetRGB() + { + var r, g, b, i, f, p, q, t; + var h = document.Ctrl_form.SH.value, s = document.Ctrl_form.SS.value, v = 255; + i = Math.floor(h * 6); + f = h * 6 - i; + p = v * (1 - s); + q = v * (1 - f * s); + t = v * (1 - (1 - f) * s); + switch (i % 6) { + case 0: r = v, g = t, b = p; break; + case 1: r = q, g = v, b = p; break; + case 2: r = p, g = v, b = t; break; + case 3: r = p, g = q, b = v; break; + case 4: r = t, g = p, b = v; break; + case 5: r = v, g = p, b = q; break; + } + document.Ctrl_form.SR.value = r; + document.Ctrl_form.SG.value = g; + document.Ctrl_form.SB.value = b; + GetCheck(); + } -

WLED Settings

+

WLED Settings

- - +
+

WiFi setup

Connect to existing network

- Network SSID (leave empty to not connect):

+ Network SSID (leave empty to not connect):
Network password:

Static IP (leave at 0.0.0.0 for DHCP):
. @@ -119,10 +116,11 @@ AP password (leave empty for open):

AP channel:
AP IP: Not active
- +

Application setup

Web setup

Server description:
+ Use HSB sliders instead of RGB by default:

LED setup

LED count (max. 255):
Default RGB color: @@ -187,9 +185,8 @@ Timezone library by JChristensen
arduino-esp8266-alexa-multiple-wemo-switch by kakopappa
Server message: XML response error! -

- - +


+
\ No newline at end of file diff --git a/wled00/data/settingssaved.htm b/wled00/data/settingssaved.htm index 8ffaa326..7b55f969 100644 --- a/wled00/data/settingssaved.htm +++ b/wled00/data/settingssaved.htm @@ -3,10 +3,6 @@ Saved Settings