Added support for default secondary color saving

Started big rework with seperated settings page, new page design, themes, effect intensity, hue sync...
pull/46/head
cschwinne 2018-01-27 23:28:20 +01:00
rodzic f3e03fc435
commit 30ee42732e
24 zmienionych plików z 632 dodań i 851 usunięć

Wyświetl plik

@ -101,6 +101,10 @@ void WS2812FX::decreaseSpeed(uint8_t s) {
setSpeed(s);
}
void WS2812FX::setIntensity(uint8_t in) {
_intensity=in;
}
void WS2812FX::setColor(uint8_t r, uint8_t g, uint8_t b) {
setColor(((uint32_t)r << 16) | ((uint32_t)g << 8) | b);
}

Wyświetl plik

@ -235,6 +235,7 @@ class WS2812FX : public NeoPixelBrightnessBus<PIXELFEATURE, PIXELMETHOD> {
setCCFS(bool fs),
setCCFE(bool fe),
setSpeed(uint8_t s),
setIntensity(uint8_t in),
increaseSpeed(uint8_t s),
decreaseSpeed(uint8_t s),
setColor(uint8_t r, uint8_t g, uint8_t b),
@ -272,6 +273,7 @@ class WS2812FX : public NeoPixelBrightnessBus<PIXELFEATURE, PIXELMETHOD> {
get_random_wheel_index(uint8_t),
getMode(void),
getSpeed(void),
getIntensity(void),
getBrightness(void),
getModeCount(void);
@ -372,6 +374,7 @@ class WS2812FX : public NeoPixelBrightnessBus<PIXELFEATURE, PIXELMETHOD> {
maxval(uint8_t v, uint8_t w),
_mode_index,
_speed,
_intensity,
_cc_i1,
_cc_i2,
_cc_is,

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -1,23 +1,25 @@
<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico'/>
<title>WLED 0.5dev</title>
<script>
var d=document;
var w=window.getComputedStyle(d.querySelector("html"));
resp="";
var nla=false;
var nra=false;
var nsa=false;
var sto=false;
var hsb=false;
var fxa=false;
var psa=false;
var uwv=false;
var firstload=true;
var lastsx = 0;
var nState = 0;
bCol = "DarkTurquoise";
dC = "black";
var cv=0;
var lm=0;
aC="";
bC="";
dC="";
function gId(s) //abbrev
{
@ -26,12 +28,12 @@
function Startup()
{
gId("fxI").addEventListener("keypress", function(event) {
if (event.keyCode == 13) {
event.preventDefault();
GetFX();
}
});
var w=window.getComputedStyle(d.querySelector("html"));
aC = w.getPropertyValue("--aCol");
bC = w.getPropertyValue("--bCol");
cC = w.getPropertyValue("--cCol");
dC = w.getPropertyValue("--dCol");
CV(0);
setInterval('GIO()', 5000);
GIO();
}
@ -50,19 +52,18 @@
d.Cf.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue;
if (this.responseXML.getElementsByTagName('wv')[0].childNodes[0].nodeValue >= 0) {
d.Cf.SW.value = this.responseXML.getElementsByTagName('wv')[0].childNodes[0].nodeValue;
if (!uwv) gId("slW").style.display="block";
uwv = true;
} else {
gId("slW").style.display="none";
uwv = false;
}
if (d.activeElement != gId("fxI")) d.Cf.TF.value = this.responseXML.getElementsByTagName('fx')[0].childNodes[0].nodeValue;
if (d.activeElement != Cf.TX) Cf.TX.selectedIndex = this.responseXML.getElementsByTagName('fx')[0].childNodes[0].nodeValue;
d.Cf.SX.value = this.responseXML.getElementsByTagName('sx')[0].childNodes[0].nodeValue;
d.Cf.IX.value = this.responseXML.getElementsByTagName('ix')[0].childNodes[0].nodeValue;
nla = (this.responseXML.getElementsByTagName('nl')[0].innerHTML)!=0?true:false;
nState = 0;
nState = (this.responseXML.getElementsByTagName('nr')[0].innerHTML)!=0?1:0;
nState += (this.responseXML.getElementsByTagName('ns')[0].innerHTML)!=0?2:0;
if(firstload)hsb = (this.responseXML.getElementsByTagName('md')[0].innerHTML)!=0?true:false;
if(firstload)CV(this.responseXML.getElementsByTagName('md')[0].childNodes[0].nodeValue);
d.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('desc')[0].innerHTML;
UV();
}
@ -74,7 +75,7 @@
resp="";
firstload=false;
}
function GetCheck()
function GC()
{
resp+="&A=" + Cf.SA.value;
resp+="&R=" + Cf.SR.value;
@ -84,37 +85,97 @@
UV();
GIO();
}
function GetFX()
function GX()
{
resp+="&FX=" + Cf.TF.value;
resp+="&FX=" + Cf.TX.selectedIndex;
resp+="&SX=" + Cf.SX.value;
resp+="&IX=" + Cf.IX.value;
UV();
GIO();
}
function GetRGB()
{
var r, g, b, i, f, p, q, t;
var h = d.Cf.SH.value, s = d.Cf.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;
}
d.Cf.SR.value=r;
d.Cf.SG.value=g;
d.Cf.SB.value=b;
GC();
}
function GetCC()
{
resp+="&CP=";
resp+=d.Cf.PF.value;
resp+="&CS=";
resp+=d.Cf.SF.value;
resp+="&CM=";
resp+=d.Cf.HF.value;
resp+=(d.Cf.SC.checked)?"&CF=1":"&CF=0";
resp+=(d.Cf.EC.checked)?"&CE=1":"&CE=0";
GIO();
}
function CV(v)
{
if (sto) CloseSettings();
gId("slA").style.display="none";
gId("srgb").style.display="none";
gId("shs").style.display="none";
gId("slW").style.display="none";
gId("tlX").style.display="none";
gId("tlP").style.display="none";
gId("tlN").style.display="none";
if (v<2){
if (uwv) gId("slW").style.display="block";
gId("slA").style.display="block";
}
switch(v){
case 0: gId("srgb").style.display="block";lm=0;break;
case 1: gId("shs").style.display="block";lm=1;break;
case 2: gId("tlP").style.display="block";break;
case 3: gId("tlX").style.display="block";break;
case 4: gId("tlN").style.display="block";
}
cv=v;
mdb.style.fill=(lm>0)?aC:dC;
}
function rgb2hex(red,green,blue) {
var rgb = blue | (green << 8) | (red << 16);
return '#' +(0x1000000 +rgb).toString(16).slice(1)
}
function lingrad(r,g,b) {
return "linear-gradient(white, "+rgb2hex(r,g,b)+")";
return "linear-gradient("+bC+","+rgb2hex(r,g,b)+")";
}
function UV()
{
d.body.style.background = lingrad(Cf.SR.value,Cf.SG.value,Cf.SB.value);
setHS(Cf.SR.value,Cf.SG.value,Cf.SB.value);
SetHSB();
nlb.style.fill=(nla)?bCol:dC;
fxb.style.fill=(d.Cf.TX.selectedIndex>0)?aC:dC;
nlb.style.fill=(nla)?aC:dC;
ntb.style.fill=(nla)?aC:dC;
switch(nState)
{
case 0: gId("path1").style.fill = dC; gId("path2").style.fill = dC;break;
case 1: gId("path1").style.fill = bCol; gId("path2").style.fill = dC;break;
case 2: gId("path1").style.fill = dC;gId("path2").style.fill = bCol;break;
case 3: gId("path1").style.fill = bCol; gId("path2").style.fill = bCol;
case 1: gId("path1").style.fill = aC; gId("path2").style.fill = dC;break;
case 2: gId("path1").style.fill = dC;gId("path2").style.fill = aC;break;
case 3: gId("path1").style.fill = aC; gId("path2").style.fill = aC;
}
tgb.style.fill=(Cf.SA.value>0)?bCol:dC;
ccX.style.display=(Cf.TF.value>52)?"block":"none";
fof.style.fill=(Cf.TF.value>52)?bCol:dC;
fmr.style.fill=(Cf.TF.value<1)?bCol:dC;
tgb.style.fill=(Cf.SA.selectedIndex>0)?aC:dC;
ccX.style.display=(Cf.TX.selectedIndex>52)?"block":"none";
fof.style.fill=(Cf.TX.selectedIndex>52)?aC:dC;
fmr.style.fill=(Cf.TX.selectedIndex<1)?aC:dC;
}
function TgT()
{
@ -129,93 +190,22 @@
UV();
GIO();
}
function TgFX()
function SwFX(s)
{
if (psa)
{
psa = false;
SetPS();
}
fxa = !fxa;
if (sto) CloseSettings();
SetFX();
}
function SwitchFX(s)
{
d.Cf.TF.value = parseInt(d.Cf.TF.value) +s;
if (d.Cf.TF.value < 0) d.Cf.TF.value = 0;
if (d.Cf.TF.value > 57) d.Cf.TF.value = 53;
GetFX();
}
function SetFX()
{
if (fxa) {
fxb.style.fill=bCol;
gId("slA").style.display="none";
gId("slR").style.display="none";
gId("slG").style.display="none";
gId("slB").style.display="none";
gId("slH").style.display="none";
gId("slS").style.display="none";
gId("slW").style.display="none";
gId("slX").style.display="block";
gId("tlX").style.display="block";
gId("tlP").style.display="none";
} else {
fxb.style.fill=dC;
gId("slA").style.display="block";
gId("slX").style.display="none";
gId("tlX").style.display="none";
if (uwv) gId("slW").style.display="block";
SetHSB();
}
}
function SetHSB()
{
if (fxa || psa) return;
if (hsb)
{
gId("slR").style.display="none";
gId("slG").style.display="none";
gId("slB").style.display="none";
gId("slH").style.display="block";
gId("slS").style.display="block";
mdb.style.fill=bCol;
} else {
gId("slR").style.display="block";
gId("slG").style.display="block";
gId("slB").style.display="block";
gId("slH").style.display="none";
gId("slS").style.display="none";
mdb.style.fill=dC;
}
var n=Cf.TX.selectedIndex+s;
Cf.TX.selectedIndex =n;
if (n < 0) Cf.TX.selectedIndex = 0;
if (n > 57) Cf.TX.selectedIndex = 53;
GX();
}
function TgHSB()
{
if (fxa)
if (cv<2)
{
fxa = false;
SetFX();
(cv)?CV(0):CV(1);
}else{
CV(lm);
}
if (psa)
{
psa = false;
SetPS();
}
if (sto) CloseSettings();
hsb = !hsb;
resp+=((hsb)?"&MD=1":"&MD=0");
SetHSB();
}
function TgPS()
{
psa = !psa;
fxa = true;
SetFX();
fxa = false;
fxb.style.fill=dC;
if (sto) CloseSettings();
SetPS();
}
function SwitchPS(x)
{
@ -223,23 +213,6 @@
if (d.Cf.FF.value < 0) d.Cf.FF.value = 0;
if (d.Cf.FF.value > 24) d.Cf.FF.value = 24;
}
function SetPS()
{
if (psa) {
psb.style.fill=bCol;
gId("slX").style.display="none";
gId("tlX").style.display="none";
gId("tlP").style.display="block";
} else {
psb.style.fill=dC;
gId("slA").style.display="block";
gId("slX").style.display="none";
gId("tlX").style.display="none";
gId("tlP").style.display="none";
if (uwv) gId("slW").style.display="block";
SetHSB();
}
}
function PSIO(sv)
{
if(sv)
@ -261,7 +234,7 @@
function OpenSettings()
{
sto=true;
stb.style.fill=bCol;
stb.style.fill=aC;
cdB.style.display="none";
stf.style.display="inline";
stf.src="/settings";
@ -273,7 +246,7 @@
cdB.style.display="inline";
stf.style.display="none";
}
function TgSettings()
function TgS()
{
if(sto)
{
@ -285,7 +258,12 @@
function TgNl()
{
nla=!nla;
resp+=(nla)?"&NL=1":"&NL=0";
if(nla){
resp+="&NL="+d.Cf.SN.value;
resp+="&NT="+d.Cf.ST.value;
}else{
resp+="&NL=0";
}
UV();
GIO();
}
@ -338,41 +316,7 @@
if (s>0) d.Cf.SH.value=h;
d.Cf.SS.value=s;
}
function GetRGB()
{
var r, g, b, i, f, p, q, t;
var h = d.Cf.SH.value, s = d.Cf.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;
}
d.Cf.SR.value=r;
d.Cf.SG.value=g;
d.Cf.SB.value=b;
GetCheck();
}
function GetCC()
{
resp+="&CP=";
resp+=d.Cf.PF.value;
resp+="&CS=";
resp+=d.Cf.SF.value;
resp+="&CM=";
resp+=d.Cf.HF.value;
resp+=(d.Cf.SC.checked)?"&CF=1":"&CF=0";
resp+=(d.Cf.EC.checked)?"&CE=1":"&CE=0";
GIO();
}
function ColSec(i)
function CS(i)
{
switch(i)
{
@ -387,182 +331,188 @@
}
</script>
<style>
:root {
--aCol: #D9B310;
--bCol: #0B3C5D;
--cCol: #1D2731;
--dCol: #328CC1;
--sCol: #000;
}
.ctrl_box {
margin: auto;
width: 80vw;
background-color: #b9b9b9;
background-color: var(--cCol);
position: absolute;
top: 60%;
top: 55%;
left: 50%;
transform: translate(-50%, -50%);
filter: drop-shadow( -5px -5px 5px var(--sCol) );
}
input[type=number] {
width: 3em;
}
.sliders {
.sds {
width: 100%;
height: 12vh;
margin-top: 2vh;
}
.sliderA {
.sl {
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
}
#slA {
margin-top: 0vh;
background: linear-gradient(to right, black, yellow);
}
.sliderR {
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slR {
background: linear-gradient(to right, black, red);
}
.sliderG {
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slG {
background: linear-gradient(to right, black, green);
}
.sliderB {
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slB {
background: linear-gradient(to right, black, blue);
}
.sliderW {
display:none;
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slW {
background: linear-gradient(to right, black, white);
}
.sliderH {
display:none;
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slH {
background: linear-gradient(to right, red, orange , yellow, green, cyan, blue, violet, red);
}
.sliderS {
display:none;
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slS {
background: linear-gradient(to right, grey, green);
}
.toolsFX {
display:none;
#slN {
background: linear-gradient(to right, black, turquoise);
}
#slT {
background: linear-gradient(to right, black, yellow);
}
.tools {
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
}
.toolsCC {
display:none;
}
.toolsPS {
display:none;
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
}
.sliderX {
display:none;
margin-left: auto;
margin-right: auto;
margin-top: 2vh;
width: 77vw;
#slX {
background: linear-gradient(to right, black, white);
}
#slI {
background: linear-gradient(to right, black, red);
}
body {
font-family: Verdana, Helvetica, sans-serif;
text-align: center;
background: linear-gradient(white, black);
background: linear-gradient(var(--bCol),black);
height: 100%;
margin: 0;
background-repeat: no-repeat;
background-attachment: fixed;
color: var(--dCol);
}
html {
height: 100%;
}
iframe {
display:none;
border:none;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
margin: auto;
width: 80vw;
height: 50vh;
height: 60vh;
position: absolute;
top: 60%;
top: 55%;
left: 50%;
transform: translate(-50%, -50%);
}
svg {
fill: var(--dCol);
width: 12vw;
height: 10vmin;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
}
input {
filter: drop-shadow( -5px -5px 5px var(--sCol) );
}
button {
background: var(--bCol);
color: var(--dCol);
border: 0.5ch solid var(--bCol);
margin-bottom: 1vh;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
}
select {
background: var(--bCol);
color: var(--dCol);
border: 0.5ch solid var(--bCol);
filter: drop-shadow( -5px -5px 5px var(--sCol) );
}
input[type=number] {
background: var(--bCol);
color: var(--dCol);
border: 0.5ch solid var(--bCol);
width: 3em;
}
input[type=range] {
-webkit-appearance: none;
margin: -4px 0;
-webkit-appearance: none;
margin: -4px 0;
}
input[type=range]:focus {
outline: none;
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 12vh;
cursor: pointer;
background: #DDDDDD;
width: 100%;
height: 12vh;
cursor: pointer;
background: var(--bCol);
}
input[type=range]::-webkit-slider-thumb {
height: 10vh;
width: 10vh;
background: #ffffff;
cursor: pointer;
-webkit-appearance: none;
margin-top: 1vh;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
height: 10vh;
width: 10vh;
background: var(--aCol);
cursor: pointer;
-webkit-appearance: none;
margin-top: 1vh;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 12vh;
cursor: pointer;
background: #DDDDDD;
width: 100%;
height: 12vh;
cursor: pointer;
background: var(--bCol);
}
input[type=range]::-moz-range-thumb {
height: 10vh;
width: 10vh;
background: #ffffff;
cursor: pointer;
margin-top: 1vh;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
height: 10vh;
width: 10vh;
background: var(--aCol);
cursor: pointer;
margin-top: 1vh;
}
input[type=range]::-ms-track {
width: 100%;
height: 12vh;
cursor: pointer;
background: transparent;
border-color: transparent;
color: transparent;
width: 100%;
height: 12vh;
cursor: pointer;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #DDDDDD;
background: #var(--bCol);
}
input[type=range]::-ms-fill-upper {
background: #DDDDDD;
background: #var(--bCol);
}
input[type=range]::-ms-thumb {
width: 10vh;
background: #ffffff;
cursor: pointer;
height: 10vh;
width: 10vh;
background: var(--aCol);
cursor: pointer;
height: 10vh;
}
</style>
<style id="holderjs-style" type="text/css"></style></head>
<body onload="Startup()" class=" __plain_text_READY__">
<span class="desc"> Loading... </span>
<span class="desc">Loading...</span>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
//Linearicons.com/free
@ -584,63 +534,137 @@
<div id="tbB" class="tool_box">
<svg id="tgb" onclick="TgT()"><use xlink:href="#lnr-power-switch"></use></svg>
<svg id="mdb" onclick="TgHSB()"><use xlink:href="#lnr-list"></use></svg>
<svg id="psb" onclick="TgPS()"><use xlink:href="#lnr-heart"></use></svg>
<svg id="fxb" onclick="TgFX()"><use xlink:href="#lnr-star"></use></svg>
<svg id="nlb" onclick="TgNl()"><use xlink:href="#lnr-moon"></use></svg>
<svg id="psb" onclick="CV(2)"><use xlink:href="#lnr-heart"></use></svg>
<svg id="fxb" onclick="CV(3)"><use xlink:href="#lnr-star"></use></svg>
<svg id="nlb" onclick="CV(4)"><use xlink:href="#lnr-moon"></use></svg>
<svg id="nsb" onclick="TgN()"><use xlink:href="#lnr-sync"></use></svg>
<svg id="stb" onclick="TgSettings()"><use xlink:href="#lnr-cog"></use></svg>
<svg id="stb" onclick="TgS()"><use xlink:href="#lnr-cog"></use></svg>
</div>
<div id="cdB" class="ctrl_box">
<form id="form_c" name="Cf">
<br>
<div id="slA" class="sliderA">
<input type="range" title="Brightness" class="sliders" name="SA" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div>
<div id="slR" class="sliderR">
<input type="range" title="Red Value" class="sliders" name="SR" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div>
<div id="slG" class="sliderG">
<input type="range" title="Green Value" class="sliders" name="SG" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div>
<div id="slB" class="sliderB">
<input type="range" title="Blue Value" class="sliders" name="SB" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div>
<div id="slH" class="sliderH">
<input type="range" title="Hue" class="sliders" name="SH" value="0" min="0" max="1" step="0.025" onchange="GetRGB()"> </div>
<div id="slS" class="sliderS">
<input type="range" title="Saturation" class="sliders" name="SS" value="0" min="0" max="1" step="0.025" onchange="GetRGB()"> </div>
<div id="slW" class="sliderW">
<input type="range" title="White Value" class="sliders" name="SW" value="0" min="0" max="255" step="1" onchange="GetCheck()"> </div>
<div id="tlX" class = "toolsFX">
<div id="slA" class="sl">
<input type="range" title="Brightness" class="sds" name="SA" value="0" min="0" max="255" step="1" onchange="GC()"></div>
<div id="srgb">
<div id="slR" class="sl">
<input type="range" title="Red Value" class="sds" name="SR" value="0" min="0" max="255" step="1" onchange="GC()"></div>
<div id="slG" class="sl">
<input type="range" title="Green Value" class="sds" name="SG" value="0" min="0" max="255" step="1" onchange="GC()"></div>
<div id="slB" class="sl">
<input type="range" title="Blue Value" class="sds" name="SB" value="0" min="0" max="255" step="1" onchange="GC()"></div></div>
<div id="shs">
<div id="slH" class="sl">
<input type="range" title="Hue" class="sds" name="SH" value="0" min="0" max="1" step="0.025" onchange="GetRGB()"></div>
<div id="slS" class="sl">
<input type="range" title="Saturation" class="sds" name="SS" value="0" min="0" max="1" step="0.025" onchange="GetRGB()"></div></div>
<div id="slW" class="sl">
<input type="range" title="White Value" class="sds" name="SW" value="0" min="0" max="255" step="1" onchange="GC()"></div>
<div id="tlX" class = "tools">
Effect Panel<br><br>
<svg id="fmr" onclick="SwitchFX(-100)"><use xlink:href="#lnr-cross"></use></svg>
<svg id="for" onclick="SwitchFX(-1)"><use xlink:href="#lnr-arrow-left-circle"></use></svg>
<svg id="fmf" onclick="SwitchFX(1)"><use xlink:href="#lnr-arrow-right-circle"></use></svg>
<svg id="fof" onclick="SwitchFX(100)"><use xlink:href="#lnr-rocket"></use></svg>
<br><input id="fxI" name = "TF" type="number" value="0" min="0" max="57" step="1" onchange="GetFX()"><br><br>
<svg id="fmr" onclick="SwFX(-99)"><use xlink:href="#lnr-cross"></use></svg>
<svg id="for" onclick="SwFX(-1)"><use xlink:href="#lnr-arrow-left-circle"></use></svg>
<svg id="fmf" onclick="SwFX(1)"><use xlink:href="#lnr-arrow-right-circle"></use></svg>
<svg id="fof" onclick="SwFX(99)"><use xlink:href="#lnr-rocket"></use></svg><br><br>
<select name="TX" onchange="GX()">
<option value="0" selected>Static (0)</option>
<option value="1">Blink (1)</option>
<option value="2">Breath (2)</option>
<option value="3">Wipe (3)</option>
<option value="4">Wipe Random (4)</option>
<option value="5">Color R (5)</option>
<option value="6">Single Dynamic (6)</option>
<option value="7">All Dynamic (7)</option>
<option value="8">Colorloop (8)</option>
<option value="9">Rainbow (9)</option>
<option value="10">Scan (10)</option>
<option value="11">Scan x2 (11)</option>
<option value="12">Fade (12)</option>
<option value="13">Chase (13)</option>
<option value="14">Chase Cl (14)</option>
<option value="15">Running (15)</option>
<option value="16">Twinkle (16)</option>
<option value="17">Twinkle R (17)</option>
<option value="18">Twinkle Fade (18)</option>
<option value="19">Twinkle RF (19)</option>
<option value="20">Sparkle (20)</option>
<option value="21">Sparkle Inv (21)</option>
<option value="22">Sparkle Inv+ (22)</option>
<option value="23">Strobe (23)</option>
<option value="24">Strobe Cl (24)</option>
<option value="25">Strobe + (25)</option>
<option value="26">Blink Cl (26)</option>
<option value="27">Chase (27)</option>
<option value="28">Chase Inv (28)</option>
<option value="29">Chase R (29)</option>
<option value="30">Chase Rainbow (30)</option>
<option value="31">Chase Flash (31)</option>
<option value="32">Chase RF (32)</option>
<option value="33">Chase Cl Inv (33)</option>
<option value="34">Colorful (34)</option>
<option value="35">Traffic Light (35)</option>
<option value="36">Sweep R(36)</option>
<option value="37">Running 2 (37)</option>
<option value="38">Red/Blue (38)</option>
<option value="39">Running R (39)</option>
<option value="40">Scanner (40)</option>
<option value="41">Lighthouse (41)</option>
<option value="42">Fireworks (42)</option>
<option value="43">Fireworks R (43)</option>
<option value="44">Christmas (44)</option>
<option value="45">Fire Flicker (45)</option>
<option value="46">Unused (46)</option>
<option value="47">Internal (47)</option>
<option value="48">Wipe IO (48)</option>
<option value="49">Wipe II (49)</option>
<option value="50">Wipe OO (50)</option>
<option value="51">Wipe OI (51)</option>
<option value="52">Circus (52)</option>
<option value="53">Custom Chase (53)</option>
<option value="54">CC Colorloop (54)</option>
<option value="55">CC Rainbow (55)</option>
<option value="56">CC Blink (56)</option>
<option value="57">CC Random (57)</option>
</select><br><br>
Set secondary color to
<button type="button" onclick="ColSec(0)">White</button>
<button type="button" onclick="ColSec(1)">Black</button>
<button type="button" onclick="ColSec(2)">Random</button>
<button type="button" onclick="ColSec(3)">Primary</button>
<button type="button" onclick="ColSec(4)">Swap P/S</button>
or <button type="button" onclick="ColSec(5)">Set Primary to Random</button>
<div id="ccX" class = "toolsCC">
<button type="button" onclick="CS(0)">White</button>
<button type="button" onclick="CS(1)">Black</button>
<button type="button" onclick="CS(2)">Random</button>
<button type="button" onclick="CS(3)">Primary</button>
<button type="button" onclick="CS(4)">Swap P/S</button>
or <button type="button" onclick="CS(5)">Set Primary to Random</button>
<div id="ccX">
<br>Custom Theater Chase<br>
using <input id="ccP" name = "PF" type="number" value="2" min="0" max="255" step="1" onchange="GetCC()"> primary and
<input id="ccS" name = "SF" type="number" value="4" min="0" max="255" step="1" onchange="GetCC()"> secondary color LEDs, <br>
doing <input id="ccH" name = "HF" type="number" value="1" min="0" max="255" step="1" onchange="GetCC()"> steps per tick,
using <input id="ccP" name="PF" type="number" value="2" min="0" max="255" step="1" onchange="GetCC()"> primary and
<input id="ccS" name ="SF" type="number" value="4" min="0" max="255" step="1" onchange="GetCC()"> secondary color LEDs,<br>
doing <input id="ccH" name="HF" type="number" value="1" min="0" max="255" step="1" onchange="GetCC()"> steps per tick,
from <input type="checkbox" onchange="GetCC()" name="SC"> start and <input type="checkbox" onchange="GetCC()" name="EC"> end.
</div>
<div id="slX" class="sl">
<input type="range" title="Effect Speed" class="sds" name="SX" value="0" min="0" max="255" step="1" onchange="GX()"></div>
<div id="slI" class="sl">
<input type="range" title="Effect Intensity" class="sds" name="IX" value="0" min="0" max="255" step="1" onchange="GX()"></div>
</div>
<div id="tlP" class = "toolsPS">
Favorite Presets<br><br>
<svg id="psl" onclick="PSIO(false)"><use xlink:href="#lnr-checkmark-circle"></use></svg>
<svg id="psp" onclick="SwitchPS(-1)"><use xlink:href="#lnr-arrow-left-circle"></use></svg>
<svg id="psn" onclick="SwitchPS(1)"><use xlink:href="#lnr-arrow-right-circle"></use></svg>
<svg id="pss" onclick="PSIO(true)"><use xlink:href="#lnr-arrow-down-circle"></use></svg>
<br><input id="psI" name = "FF" type="number" value="0" min="0" max="25" step="1"><br><br>
Click checkmark to apply <input type="checkbox" checked="true" name="BC"> brightness, <input type="checkbox" checked="true" name="CC"> color and <input type="checkbox" checked="true" name="FC"> effects.<br>
Effect 0 is the configuration when the light is powered up.
<div id="tlP" class = "tools">
Favorite Presets<br><br>
<svg id="psl" onclick="PSIO(false)"><use xlink:href="#lnr-checkmark-circle"></use></svg>
<svg id="psp" onclick="SwitchPS(-1)"><use xlink:href="#lnr-arrow-left-circle"></use></svg>
<svg id="psn" onclick="SwitchPS(1)"><use xlink:href="#lnr-arrow-right-circle"></use></svg>
<svg id="pss" onclick="PSIO(true)"><use xlink:href="#lnr-arrow-down-circle"></use></svg>
<br><input id="psI" name = "FF" type="number" value="0" min="0" max="25" step="1"><br><br>
Click checkmark to apply <input type="checkbox" checked="true" name="BC"> brightness, <input type="checkbox" checked="true" name="CC"> color and <input type="checkbox" checked="true" name="FC"> effects.<br>
Effect 0 is the configuration when the light is powered up.
</div>
<div id="slX" class="sliderX">
<input type="range" title="Effect Speed" class="sliders" name="SX" value="0" min="0" max="255" step="1" onchange="GetFX()"> </div> <br>
<div id="tlN" class="tools">
Timed Light<br><br>
<svg id="ntb" onclick="TgNl()"><use xlink:href="#lnr-power-switch"></use></svg><br><br>
Gradually dim down <input type="checkbox" checked="true" name="NC"><br>
1st slider sets duration (1-255min), 2nd sets target brightness.
<div id="slN" class="sl">
<input type="range" title="Duration" class="sds" name="SN" value="60" min="1" max="255" step="1"></div>
<div id="slT" class="sl">
<input type="range" title="Target Brightness" class="sds" name="ST" value="0" min="0" max="255" step="1"></div>
</div>
<br>
</form>
</div>
<iframe id="stf" src="about:blank"></iframe>

Wyświetl plik

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>WLED Message</title>
<script>
function B() {
window.history.back();
}
</script>
<style>
:root {
--aCol: #D9B310;
--bCol: #0B3C5D;
--cCol: #1D2731;
--dCol: #328CC1;
--sCol: #000;
}
body {
font-family: Verdana, Helvetica, sans-serif;
text-align: center;
background: var(--cCol);
color: var(--dCol);
line-height: 200%;
margin: 0;
background-attachment: fixed;
}
button {
background: var(--bCol);
color: var(--dCol);
border: 0.3ch solid var(--bCol);
display: inline-block;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
font-size: 20px;
margin: 8px;
margin-top: 12px;
}
</style>
</head>
<body>
<h2>Sample message.</h2>
</body>
</html>

Wyświetl plik

@ -1,135 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Settings</title>
<script>
function GetCurrent()
{
var d = document;
//values injected by server while sending HTML
d.Sf.CSSID.value = "DONT put settings.htm in SPIFFS!";
d.getElementsByClassName("msg")[0].innerHTML = "Response Error";
}
</script>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>WLED Settings</title>
<style>
body {
line-height: 150%;
}
input[type=number] {
width: 3em;
}
:root {
--aCol: #D9B310;
--bCol: #0B3C5D;
--cCol: #1D2731;
--dCol: #328CC1;
--sCol: #000;
}
body {
font-family: Verdana, Helvetica, sans-serif;
text-align: center;
background: var(--cCol);
height: 100%;
margin: 0;
background-attachment: fixed;
}
button {
background: var(--bCol);
color: var(--dCol);
border: 0.3ch solid var(--bCol);
display: inline-block;
filter: drop-shadow( -5px -5px 5px var(--sCol) );
font-size: 9vmin;
width: 95%;
margin-top: 2.4vh;
}
</style>
</head>
<body onload="GetCurrent()" class=" __plain_text_READY__">
<h1 style="text-align:center">WLED Settings</h1>
<form id="form_s" name="Sf" action="set-settings" method="post">
<div align="center"><input type="submit" name="SUBM" value="Save"></div>
<hr>
<h2>WiFi setup</h2>
<h3>Connect to existing network</h3>
Network SSID (leave empty to not connect): <br><input name="CSSID" maxlength="32"> <br>
Network password: <br> <input type="password" name="CPASS" maxlength="63"> <br>
Static IP (leave at 0.0.0.0 for DHCP): <br>
<input name="CSIP0" type="number" min="0" max="255" required> .
<input name="CSIP1" type="number" min="0" max="255" required> .
<input name="CSIP2" type="number" min="0" max="255" required> .
<input name="CSIP3" type="number" min="0" max="255" required> <br>
Static gateway: <br>
<input name="CSGW0" type="number" min="0" max="255" required> .
<input name="CSGW1" type="number" min="0" max="255" required> .
<input name="CSGW2" type="number" min="0" max="255" required> .
<input name="CSGW3" type="number" min="0" max="255" required> <br>
Static subnet mask: <br>
<input name="CSSN0" type="number" min="0" max="255" required> .
<input name="CSSN1" type="number" min="0" max="255" required> .
<input name="CSSN2" type="number" min="0" max="255" required> .
<input name="CSSN3" type="number" min="0" max="255" required> <br>
mDNS address (leave empty for no mDNS): <br/>
http:// <input name="CMDNS" maxlength="32"> .local <br>
Try connecting before opening AP for: <input name="APWTM" type="number" min="0" max="255" required> s <br>
Client IP: <span class="sip"> Not connected </span> <br>
<h3>Configure Access Point</h3>
AP SSID (leave empty for no AP): <br> <input name="APSSID" maxlength="32"> <br>
Hide AP SSID: <input type="checkbox" name="APHSSID"> <br>
AP password (leave empty for open): <br> <input type="password" name="APPASS" maxlength="63"> <br>
AP channel: <input name="APCHAN" type="number" min="1" max="13" required> <br>
AP IP: <span class="sip"> Not active </span> <br>
<hr>
<h2>Application setup</h2>
<h3>Web setup</h3>
Server description: <input name="DESC" maxlength="32"> <br>
Use HSB sliders instead of RGB by default: <input type="checkbox" name="COLMD"> <br>
<h3>LED setup</h3>
LED count (max. 255): <input name="LEDCN" type="number" min="1" max="255" required> <br>
<i>The default boot color is always saved in preset slot 0.</i><br>
Alternatively, apply preset <input name="BOOTP" type="number" min="0" max="25" required> at boot<br>
Default RGB color:
<input name="CLDFR" type="number" min="0" max="255" required>
<input name="CLDFG" type="number" min="0" max="255" required>
<input name="CLDFB" type="number" min="0" max="255" required> <br>
Default brightness: <input name="CLDFA" type="number" min="0" max="255" required> (0-255) <br>
Default white value (only RGBW, -1 to disable): <input name="CLDFW" type="number" min="-1" max="255" required> <br>
Default effect ID: <input name="FXDEF" type="number" min="0" max="57" required> <br>
Default effect speed: <input name="SXDEF" type="number" min="0" max="255" required> <br>
Ignore and use current color, brightness and effects: <input type="checkbox" name="CBEOR"> <br>
Turn on after power up/reset: <input type="checkbox" name="BOOTN"> <br>
Use Gamma correction for brightness: <input type="checkbox" name="GCBRI"> <br>
Use Gamma correction for color: <input type="checkbox" name="GCRGB"> <br>
Brightness factor: <input name="NRBRI" type="number" min="0" max="255" required> % <br>
<h3>Button setup</h3>
On/Off button enabled: <input type="checkbox" name="BTNON"> <br>
<h3>Transitions</h3>
Fade: <input type="checkbox" name="TFADE"> <br>
Sweep: <input type="checkbox" name="TSWEE"> Invert direction: <input type="checkbox" name="TSDIR"><br>
Transition Delay: <input name="TDLAY" maxlength="5" size="2"> ms <br>
<h3>Timed light</h3>
Target brightness: <input name="TLBRI" type="number" min="0" max="255" required> (0-255) <br>
Change after: <input name="TLDUR" type="number" min="0" max="255" required> min <br>
Fade: <input type="checkbox" name="TLFDE"> <br>
<h3>Broadcast</h3>
UDP Port: <input name="NUDPP" maxlength="5" size="2"><br>
Receive notifications: <input type="checkbox" name="NRCVE"> <br>
Send notifications on direct change: <input type="checkbox" name="NSDIR"> <br>
Send notifications on button press: <input type="checkbox" name="NSBTN"> <br>
<h3>Interfaces</h3>
Emulate Alexa device: <input type="checkbox" name="ALEXA"> <br>
Alexa invocation name: <input name="AINVN" maxlength="32"><br>
Send Alexa notifications: <input type="checkbox" name="NSALX"> <br>
<h3>Time (experimental!)</h3>
Requires reboot. <br>
Get time from NTP server: <input type="checkbox" name="NTPON"> <br>
Current local time is <span class="times">unknown</span> <br>
<h3>Advanced</h3>
Default overlay ID: <input name="OLDEF" type="number" min="0" max="255" required> <br>
WARLS offset: <input name="WOFFS" type="number" min="-255" max="255" required><br>
<h3>Security</h3>
OTA locked: <input type="checkbox" name="NOOTA"> <br>
Passphrase: <input type="password" name="OPASS" maxlength="32"> <br>
To enable OTA, for security reasons you need to also enter the correct password! <br>
The password may/should be changed when OTA is enabled. <br>
Disable OTA when not in use, otherwise an attacker could reflash device software! <br> <br>
Disable recovery AP: <input type="checkbox" name="NORAP"> <br>
In case of a connection error there will be no wireless recovery possible! <br>
Completely disables all Access Point functions. <br>
Setting only changable if OTA is enabled! <br><br>
Factory reset: <input type="checkbox" name="RESET"> <br>
All EEPROM content (settings) will be erased. <br> <br>
HTTP traffic is not encrypted. An attacker in the same network could intercept form data!<br>
<h3>About</h3>
WLED version 0.5dev <br>
(c) 2016-2018 Christian Schwinne <br>
<i>Licensed under the MIT license</i> <br><br>
<i>Uses libraries:</i> <br>
<i>ESP8266 Arduino Core</i> <br>
<i>WS2812FX by kitesurfer1404 (Aircoookie fork)</i> <br>
<i>Timezone library by JChristensen</i> <br>
<i>arduino-esp8266-alexa-multiple-wemo-switch by kakopappa</i> <br><br>
<i>UI icons by <a href="https://linearicons.com">Linearicons</a> created by <a href="https://perxis.com">Perxis</a>! (CC-BY-SA 4.0)</i> <br><br>
Server message: <span class="msg"> XML response error! </span>
<br><br><hr>
<div align="center"><input type="submit" name="SUBM" value="Save"></div>
</form>
<body>
<form action="/settings/wifi" method="post"><button type="submit">WiFi Setup</button></form>
<form action="/settings/leds" method="post"><button type="submit">LED Preferences</button></form>
<form action="/settings/ui" method="post"><button type="submit">User Interface</button></form>
<form action="/settings/sync" method="post"><button type="submit">Sync Interfaces</button></form>
<form action="/settings/time" method="post"><button type="submit">Time & Macros</button></form>
<form action="/settings/sec" method="post"><button type="submit">Security & Updates</button></form>
</body>
</html>

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Saved Settings</title>
<script>
function OpenReboot()
{
window.open("/reset","_self");
}
</script>
</head><body>
<div align="center">
<h2>Settings saved.</h2>
<p>If you made changes to WiFi configuration, please reboot.</p><br>
<input type="button" value="Reboot" onclick="OpenReboot()">
</div></body>
</html>

Wyświetl plik

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>WLED Setup</title>
<style>
:root {
--aCol: #D9B310;
--bCol: #0B3C5D;
--cCol: #1D2731;
--dCol: #328CC1;
--sCol: #000;
}
body {
font-family: Verdana, Helvetica, sans-serif;
text-align: center;
background: linear-gradient(var(--bCol),black);
height: 100%;
margin: 0;
background-repeat: no-repeat;
background-attachment: fixed;
color: var(--dCol);
}
svg {
fill: var(--dCol);
}
</style>
</head>
<body>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="lnr-smile" viewBox="0 0 1024 1024"><path d="M486.4 1024c-129.922 0-252.067-50.594-343.936-142.464s-142.464-214.014-142.464-343.936c0-129.923 50.595-252.067 142.464-343.936s214.013-142.464 343.936-142.464c129.922 0 252.067 50.595 343.936 142.464s142.464 214.014 142.464 343.936-50.594 252.067-142.464 343.936c-91.869 91.87-214.014 142.464-343.936 142.464zM486.4 102.4c-239.97 0-435.2 195.23-435.2 435.2s195.23 435.2 435.2 435.2 435.2-195.23 435.2-435.2-195.23-435.2-435.2-435.2z"></path><path d="M332.8 409.6c-42.347 0-76.8-34.453-76.8-76.8s34.453-76.8 76.8-76.8 76.8 34.453 76.8 76.8-34.453 76.8-76.8 76.8zM332.8 307.2c-14.115 0-25.6 11.485-25.6 25.6s11.485 25.6 25.6 25.6 25.6-11.485 25.6-25.6-11.485-25.6-25.6-25.6z"></path><path d="M640 409.6c-42.349 0-76.8-34.453-76.8-76.8s34.451-76.8 76.8-76.8 76.8 34.453 76.8 76.8-34.451 76.8-76.8 76.8zM640 307.2c-14.115 0-25.6 11.485-25.6 25.6s11.485 25.6 25.6 25.6 25.6-11.485 25.6-25.6-11.485-25.6-25.6-25.6z"></path><path d="M486.4 870.4c-183.506 0-332.8-149.294-332.8-332.8 0-14.139 11.462-25.6 25.6-25.6s25.6 11.461 25.6 25.6c0 155.275 126.325 281.6 281.6 281.6s281.6-126.325 281.6-281.6c0-14.139 11.461-25.6 25.6-25.6s25.6 11.461 25.6 25.6c0 183.506-149.294 332.8-332.8 332.8z"></path></symbol>
</defs></svg>
<br><br>
<svg><use xlink:href="#lnr-smile"></use></svg>
<h1>Welcome to WLED!</h1>
<h3>Thank you for installing my application!</h3>
Take a quick look at the <a href="https://github.com/Aircoookie/WLED/wiki" target="_blank">wiki</a>!<br>
If you encounter a bug or have a question/feature suggestion, feel free to open a GitHub issue!<br><br>
<b>Next steps:</b><br><br>
Connect the module to your local WiFi <a href="/settings/wifi">here</a>!<br><br>
<i>Just trying this out in AP mode?</i> <a href="/sliders">Here are the controls.</a><br>
</body>
</html>

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -1,157 +1,17 @@
/*
* Settings html (part 1)
* Settings html
*/
const char PAGE_settings0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<title>Settings</title>
<script>function GetCurrent(){
var d=document;
)=====";
const char PAGE_settings1[] PROGMEM = R"=====(
}</script>
<style>
body {
line-height: 150%;
}
input[type=number] {width: 3em;}
</style>
</head>
<body onload="GetCurrent()" class=" __plain_text_READY__">
<h1 style="text-align:center">WLED Settings</h1>
<form id="form_s" name="Sf" action="set-settings" method="post">
<div align="center"><input type="submit" name="SUBM" value="Save"></div>
<hr>
<h2>WiFi setup</h2>
<h3>Connect to existing network</h3>
Network SSID (leave empty to not connect): <br><input name="CSSID" maxlength="32"> <br>
Network password: <br> <input type="password" name="CPASS" maxlength="63"> <br>
Static IP (leave at 0.0.0.0 for DHCP): <br>
<input name="CSIP0" type="number" min="0" max="255" required> .
<input name="CSIP1" type="number" min="0" max="255" required> .
<input name="CSIP2" type="number" min="0" max="255" required> .
<input name="CSIP3" type="number" min="0" max="255" required> <br>
Static gateway: <br>
<input name="CSGW0" type="number" min="0" max="255" required> .
<input name="CSGW1" type="number" min="0" max="255" required> .
<input name="CSGW2" type="number" min="0" max="255" required> .
<input name="CSGW3" type="number" min="0" max="255" required> <br>
Static subnet mask: <br>
<input name="CSSN0" type="number" min="0" max="255" required> .
<input name="CSSN1" type="number" min="0" max="255" required> .
<input name="CSSN2" type="number" min="0" max="255" required> .
<input name="CSSN3" type="number" min="0" max="255" required> <br>
mDNS address (leave empty for no mDNS): <br/>
http:// <input name="CMDNS" maxlength="32"> .local <br>
Try connecting before opening AP for: <input name="APWTM" type="number" min="0" max="255" required> s <br>
Client IP: <span class="sip"> Not connected </span> <br>
<h3>Configure Access Point</h3>
AP SSID (leave empty for no AP): <br> <input name="APSSID" maxlength="32"> <br>
Hide AP SSID: <input type="checkbox" name="APHSSID"> <br>
AP password (leave empty for open): <br> <input type="password" name="APPASS" maxlength="63"> <br>
AP channel: <input name="APCHAN" maxlength="2" size="2"> <br>
AP IP: <span class="sip"> Not active </span> <br>
<hr>
<h2>Application setup</h2>
<h3>Web setup</h3>
Server description: <input name="DESC" maxlength="32"> <br>
Use HSB sliders instead of RGB by default: <input type="checkbox" name="COLMD"> <br>
<h3>LED setup</h3>
LED count (max. 255): <input name="LEDCN" type="number" min="1" max="255" required> <br>
<i>The default boot color is saved in preset slot 0.</i><br>
Alternatively, apply preset <input name="BOOTP" type="number" min="0" max="25" required> at boot<br>
Default RGB color:
<input name="CLDFR" type="number" min="0" max="255" required>
<input name="CLDFG" type="number" min="0" max="255" required>
<input name="CLDFB" type="number" min="0" max="255" required> <br>
Default brightness: <input name="CLDFA" type="number" min="0" max="255" required> (0-255) <br>
Default white value (only RGBW, -1 to disable): <input name="CLDFW" type="number" min="-1" max="255" required> <br>
Default effect ID: <input name="FXDEF" type="number" min="0" max="255" required> <br>
Default effect speed: <input name="SXDEF" type="number" min="0" max="255" required> <br>
Ignore and use current color, brightness and effects: <input type="checkbox" name="CBEOR"> <br>
Turn on after power up/reset: <input type="checkbox" name="BOOTN"> <br>
Use Gamma correction for brightness: <input type="checkbox" name="GCBRI"> <br>
Use Gamma correction for color: <input type="checkbox" name="GCRGB"> <br>
Brightness factor: <input name="NRBRI" type="number" min="0" max="255" required> % <br>
<h3>Button setup</h3>
On/Off button enabled: <input type="checkbox" name="BTNON"> <br>
<h3>Transitions</h3>
Fade: <input type="checkbox" name="TFADE"> <br>
Sweep: <input type="checkbox" name="TSWEE"> Invert direction: <input type="checkbox" name="TSDIR"><br>
Transition Delay: <input name="TDLAY" maxlength="5" size="2"> ms <br>
<h3>Timed light</h3>
Target brightness: <input name="TLBRI" type="number" min="0" max="255" required> (0-255) <br>
Change after: <input name="TLDUR" type="number" min="0" max="255" required> min <br>
Fade: <input type="checkbox" name="TLFDE"> <br>
<h3>Broadcast</h3>
UDP Port: <input name="NUDPP" maxlength="5" size="2"><br>
Receive notifications: <input type="checkbox" name="NRCVE"> <br>
Send notifications on direct change: <input type="checkbox" name="NSDIR"> <br>
Send notifications on button press: <input type="checkbox" name="NSBTN"> <br>
<h3>Interfaces</h3>
Emulate Alexa device: <input type="checkbox" name="ALEXA"> <br>
Alexa invocation name: <input name="AINVN" maxlength="32"><br>
Send Alexa notifications: <input type="checkbox" name="NSALX"> <br>
<h3>Time (experimental!)</h3>
Requires reboot. <br>
Get time from NTP server: <input type="checkbox" name="NTPON"> <br>
Current local time is <span class="times">unknown</span> <br>
<h3>Advanced</h3>
Default overlay ID: <input name="OLDEF" type="number" min="0" max="255" required> <br>
WARLS offset: <input name="WOFFS" type="number" min="-255" max="255" required><br>
<h3>Security</h3>
OTA locked: <input type="checkbox" name="NOOTA"> <br>
Passphrase: <input type="password" name="OPASS" maxlength="32"> <br>
To enable OTA, for security reasons you need to also enter the correct password! <br>
The password may/should be changed when OTA is enabled. <br>
Disable OTA when not in use, otherwise an attacker could reflash device software! <br> <br>
Disable recovery AP: <input type="checkbox" name="NORAP"> <br>
In case of a connection error there will be no wireless recovery possible! <br>
Completely disables all Access Point functions. <br>
Setting only changable if OTA is enabled! <br><br>
Factory reset: <input type="checkbox" name="RESET"> <br>
All EEPROM content (settings) will be erased. <br> <br>
HTTP traffic is not encrypted. An attacker in the same network could intercept form data!<br>
<h3>About</h3>
WLED version 0.5dev <br>
(c) 2016-2018 Christian Schwinne <br>
<i>Licensed under the MIT license</i> <br><br>
<i>Uses libraries:</i> <br>
<i>ESP8266 Arduino Core</i> <br>
<i>WS2812FX by kitesurfer1404 (Aircoookie fork)</i> <br>
<i>Timezone library by JChristensen</i> <br>
<i>arduino-esp8266-alexa-multiple-wemo-switch by kakopappa</i> <br><br>
<i>UI icons by <a href="https://linearicons.com">Linearicons</a> created by <a href="https://perxis.com">Perxis</a>! (CC-BY-SA 4.0)</i> <br><br>
Server message: <span class="msg"> XML response error! </span>
<br><br><hr>
<div align="center"><input type="submit" name="SUBM" value="Save"></div>
</form>
</body>
</html>
)=====";
/*
* Settings set html
*/
const char PAGE_settingssaved[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Saved Settings</title>
<script>
function OpenReboot()
{
window.open("/reset","_self");
}
</script>
</head><body>
<div align="center">
<h2>Settings saved.</h2>
<p>If you made changes to WiFi configuration, please reboot.</p><br>
<input type="button" value="Reboot" onclick="OpenReboot()">
</div></body>
</html>
const char PAGE_msg[] PROGMEM = R"=====(
)=====";

33
wled00/htmls02.h 100644

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -29,7 +29,7 @@
#include "WS2812FX.h"
//version in format yymmddb (b = daily build)
#define VERSION 1801164
#define VERSION 1801180
const String versionName = "WLED 0.5dev";
//AP and OTA default passwords (change them!)
@ -45,7 +45,7 @@ boolean useRGBW = false;
//support for the CRONIXIE clock by Diamex (disable overlays!)
//#define CRONIXIE
//spiffs FS only useful for debug
//spiffs FS only useful for debug (only ESP8266)
//#define USEFS
//to toggle usb serial debug (un)comment following line
@ -53,7 +53,6 @@ boolean useRGBW = false;
//Hardware-settings (only changeble via code)
#define LEDCOUNT 255 //maximum, exact count set-able via settings
#define MAXDIRECT 255 //for direct access like arls, should be >= LEDCOUNT
uint8_t buttonPin = 0; //needs pull-up
uint8_t auxPin = 15; //use e.g. for external relay
uint8_t auxDefaultState = 0; //0: input 1: high 2: low
@ -69,8 +68,6 @@ time_t local;
#ifdef CRONIXIE
#undef LEDCOUNT
#define LEDCOUNT 60
#undef MAXDIRECT
#define MAXDIRECT 48
uint8_t ledcount = 6;
String apssid = "CRONIXIE-AP";
String alexaInvocationName = "Clock";
@ -124,6 +121,7 @@ boolean nightlightFade = true;
uint16_t udpPort = 21324;
uint8_t effectDefault = 0;
uint8_t effectSpeedDefault = 75;
uint8_t effectIntensityDefault = 128;
//NTP stuff
#ifndef CRONIXIE
boolean ntpEnabled = false;
@ -177,8 +175,9 @@ boolean nightlightActive_old = false;
int nightlightDelayMs;
uint8_t effectCurrent = 0;
uint8_t effectSpeed = 75;
uint8_t effectIntensity = 128;
boolean udpConnected = false;
byte udpIn[MAXDIRECT*4+2];
byte udpIn[1026];
//NTP stuff
boolean ntpConnected = false;
unsigned int ntpLocalPort = 2390;
@ -218,6 +217,7 @@ boolean arlsSign = true;
uint8_t auxTime = 0;
unsigned long auxStartTime;
boolean auxActive, auxActiveBefore;
boolean initialBoot = false;
boolean useGammaCorrectionBri = false;
boolean useGammaCorrectionRGB = true;
@ -243,11 +243,12 @@ WiFiUDP ntpUdp;
WS2812FX strip = WS2812FX(LEDCOUNT);
//eeprom Version code, enables default settings instead of 0 init on update
#define EEPVER 3
#define EEPVER 4
//0 -> old version, default
//1 -> 0.4p 1711272 and up
//2 -> 0.4p 1711302 and up
//3 -> 0.4 1712121 and up
//4 -> 0.5dev 1801271 and up
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print (x)

Wyświetl plik

@ -87,7 +87,7 @@ void saveSettingsToEEPROM()
}
EEPROM.write(324, effectDefault);
EEPROM.write(325, effectSpeedDefault);
//326 reserved for effectIntensity
EEPROM.write(326, effectIntensityDefault);
EEPROM.write(327, ntpEnabled);
//328 reserved for timezone setting
//329 reserved for dst setting
@ -246,10 +246,10 @@ void loadSettingsFromEEPROM(bool first)
}
//377 = lastEEPROMversion
if (lastEEPROMversion > 1) {
col_sec_s[0] = EEPROM.read(378);
col_sec_s[1] = EEPROM.read(379);
col_sec_s[2] = EEPROM.read(380);
white_sec_s = EEPROM.read(381);
col_sec_s[0] = EEPROM.read(378); col_sec[0] = col_sec_s[0];
col_sec_s[1] = EEPROM.read(379); col_sec[1] = col_sec_s[1];
col_sec_s[2] = EEPROM.read(380); col_sec[2] = col_sec_s[2];
white_sec_s = EEPROM.read(381); white_sec = white_sec_s;
cc_index1 = EEPROM.read(382);
cc_index2 = EEPROM.read(383);
cc_numPrimary = EEPROM.read(384);
@ -259,6 +259,9 @@ void loadSettingsFromEEPROM(bool first)
cc_step = EEPROM.read(388);
strip.setCustomChase(cc_index1, cc_index2, cc_start, cc_numPrimary, cc_numSecondary, cc_step, cc_fromStart, cc_fromEnd);
}
if (lastEEPROMversion > 3) {
effectIntensityDefault = EEPROM.read(326); effectIntensity = effectIntensityDefault;
}
bootPreset = EEPROM.read(389);
//favorite setting memory (25 slots/ each 20byte)
@ -271,12 +274,13 @@ void loadSettingsFromEEPROM(bool first)
strip.setMode(effectCurrent);
strip.setSpeed(effectSpeed);
strip.setIntensity(effectIntensity);
overlayCurrent = overlayDefault;
}
//PRESET PROTOCOL 20 bytes
//0: preset purpose byte 0:invalid 1:valid preset 1.0
//1:a 2:r 3:g 4:b 5:w 6:er 7:eg 8:eb 9:ew 10:fx 11:sx | custom chase 12:numP 13:numS 14:(0:fs 1:both 2:fe) 15:step 16-19:Zeros
//1:a 2:r 3:g 4:b 5:w 6:er 7:eg 8:eb 9:ew 10:fx 11:sx | custom chase 12:numP 13:numS 14:(0:fs 1:both 2:fe) 15:step 16:ix 17-19:Zeros
void applyPreset(uint8_t index, bool loadBri, bool loadCol, bool loadFX)
{
@ -300,6 +304,7 @@ void applyPreset(uint8_t index, bool loadBri, bool loadCol, bool loadFX)
{
effectCurrent = EEPROM.read(i+10);
effectSpeed = EEPROM.read(i+11);
effectIntensity = EEPROM.read(i+16);
cc_numPrimary = EEPROM.read(i+12);
cc_numSecondary = EEPROM.read(i+13);
cc_fromEnd = EEPROM.read(i+14);
@ -308,6 +313,7 @@ void applyPreset(uint8_t index, bool loadBri, bool loadCol, bool loadFX)
strip.setCustomChase(cc_index1, cc_index2, cc_start, cc_numPrimary, cc_numSecondary, cc_step, cc_fromStart, cc_fromEnd);
strip.setMode(effectCurrent);
strip.setSpeed(effectSpeed);
strip.setIntensity(effectIntensity);
}
}
@ -335,6 +341,7 @@ void savePreset(uint8_t index)
if (!cc_fromEnd) m = 0;
EEPROM.write(i+14, m);
EEPROM.write(i+15, cc_step);
EEPROM.write(i+16, effectIntensity);
EEPROM.commit();
}

Wyświetl plik

@ -33,7 +33,9 @@ void XML_response()
resp = resp + effectCurrent;
resp = resp + "</fx><sx>";
resp = resp + effectSpeed;
resp = resp + "</sx><wv>";
resp = resp + "</sx><ix>";
resp = resp + effectIntensity;
resp = resp + "</ix><wv>";
if (useRGBW) {
resp = resp + white;
} else {
@ -49,9 +51,11 @@ void XML_response()
server.send(200, "text/xml", resp);
}
String getSettings()
String getSettings(uint8_t subPage)
{
DEBUG_PRINTLN("settings resp");
//0: menu 1: wifi 2: leds 3: ui 4: sync 5: time 6: sec
DEBUG_PRINT("settings resp");
DEBUG_PRINTLN(subPage);
String resp = "";
String ds = "d.Sf.";
@ -103,6 +107,10 @@ String getSettings()
} else {
resp += ds + "CLDFW" + v + "-1;";
}
resp += ds + "CSECR" + v + col_sec_s[0] +";";
resp += ds + "CSECG" + v + col_sec_s[1] +";";
resp += ds + "CSECB" + v + col_sec_s[2] +";";
resp += ds + "CSECW" + v + white_s +";";
resp += ds + "BOOTN" + c + turnOnAtBoot +";";
resp += ds + "BOOTP" + v + bootPreset +";";
resp += ds + "FXDEF" + v + effectDefault +";";

Wyświetl plik

@ -122,11 +122,12 @@ void handleSettingsSet()
if (i >= 0 && i <= LEDCOUNT) ledcount = i;
strip.setLedCount(ledcount);
}
if (server.hasArg("CBEOR"))
if (server.hasArg("CBEOR")) //ignore settings and save current brightness, colors and fx as default
{
col_s[0] = col[0];
col_s[1] = col[1];
col_s[2] = col[2];
if (useRGBW) white_s = white;
bri_s = bri;
effectDefault = effectCurrent;
effectSpeedDefault = effectSpeed;
@ -146,6 +147,26 @@ void handleSettingsSet()
int i = server.arg("CLDFB").toInt();
if (i >= 0 && i <= 255) col_s[2] = i;
}
if (server.hasArg("CSECR"))
{
int i = server.arg("CSECR").toInt();
if (i >= 0 && i <= 255) col_sec_s[0] = i;
}
if (server.hasArg("CSECG"))
{
int i = server.arg("CSECG").toInt();
if (i >= 0 && i <= 255) col_sec_s[1] = i;
}
if (server.hasArg("CSECB"))
{
int i = server.arg("CSECB").toInt();
if (i >= 0 && i <= 255) col_sec_s[2] = i;
}
if (server.hasArg("CSECW"))
{
int i = server.arg("CSECW").toInt();
if (i >= 0 && i <= 255) white_sec_s = i;
}
if (server.hasArg("CLDFW"))
{
int i = server.arg("CLDFW").toInt();
@ -163,12 +184,6 @@ void handleSettingsSet()
int i = server.arg("CLDFA").toInt();
if (i >= 0 && i <= 255) bri_s = i;
}
turnOnAtBoot = server.hasArg("BOOTN");
if (server.hasArg("BOOTP"))
{
int i = server.arg("BOOTP").toInt();
if (i >= 0 && i <= 25) bootPreset = i;
}
if (server.hasArg("FXDEF"))
{
int i = server.arg("FXDEF").toInt();
@ -180,6 +195,12 @@ void handleSettingsSet()
if (i >= 0 && i <= 255) effectSpeedDefault = i;
}
}
turnOnAtBoot = server.hasArg("BOOTN");
if (server.hasArg("BOOTP"))
{
int i = server.arg("BOOTP").toInt();
if (i >= 0 && i <= 25) bootPreset = i;
}
useGammaCorrectionBri = server.hasArg("GCBRI");
useGammaCorrectionRGB = server.hasArg("GCRGB");
buttonEnabled = server.hasArg("BTNON");

Wyświetl plik

@ -87,19 +87,18 @@ void wledInit()
if(!handleFileRead("/favicon.ico")) server.send(200, "image/x-icon", favicon);
});
server.on("/", HTTP_GET, [](){
if(!handleFileRead("/index.htm")) {
if (!arlsTimeout) //do not serve while receiving realtime
{
server.setContentLength(strlen_P(PAGE_index0) + strlen_P(PAGE_index1) + strlen_P(PAGE_index2));
server.send(200, "text/html", "");
server.sendContent_P(PAGE_index0);
server.sendContent_P(PAGE_index1);
server.sendContent_P(PAGE_index2);
} else {
server.send(200, "text/plain", "The WLED UI is not available while receiving real-time data.");
if (!initialBoot){
if(!handleFileRead("/index.htm")) {
serveIndex();
}
}else{
if(!handleFileRead("/welcome.htm")) {
serveWelcomePage();
}
}
});
server.on("/sliders", HTTP_GET, serveIndex)
server.on("/welcome", HTTP_GET, serveWelcomePage)
server.on("/reset", HTTP_GET, [](){
server.send(200, "text/plain", "Rebooting...");
reset();
@ -134,13 +133,13 @@ void wledInit()
#endif
info += "name: " + versionName + "\r\n";
info += "version: " + (String)VERSION + "\r\n";
info += "eepver: " + String(EEPVER) + "\r\n";
#ifdef RGBW
info += "rgbw: true\r\n";
#else
info += "rgbw: false\r\n";
#endif
info += "max-leds: " + (String)LEDCOUNT + "\r\n";
info += "max-direct: " + (String)MAXDIRECT + "\r\n";
#ifdef USEOVERLAYS
info += "overlays: true\r\n";
#else
@ -231,9 +230,7 @@ void wledInit()
// Initialize NeoPixel Strip
strip.init();
strip.setLedCount(ledcount);
strip.setMode(effectCurrent);
strip.setColor(0);
strip.setSpeed(effectSpeed);
strip.setBrightness(255);
strip.start();
@ -279,3 +276,46 @@ void initCon()
}
}
void buildCssColorString()
{
cssColorString=":root{--aCol:";
cssColorString+=cssCol[0];
cssColorString+=";--bCol:";
cssColorString+=cssCol[1];
cssColorString+=";--cCol:";
cssColorString+=cssCol[2];
cssColorString+=";--dCol:";
cssColorString+=cssCol[3];
cssColorString+=";--sCol:";
cssColorString+=cssCol[4];
cssColorString+=";}";
}
void serveIndex()
{
if (!arlsTimeout) //do not serve while receiving realtime
{
server.setContentLength(strlen_P(PAGE_index0) + cssColorString.length() + strlen_P(PAGE_index1) + strlen_P(PAGE_index2) + strlen_P(PAGE_index3));
server.send(200, "text/html", "");
server.sendContent_P(PAGE_index0);
server.sendContent(cssColorString);
server.sendContent_P(PAGE_index1);
server.sendContent_P(PAGE_index2);
server.sendContent_P(PAGE_index3);
} else {
server.send(200, "text/plain", "The WLED UI is not available while receiving real-time data.");
}
}
void serveWelcomePage()
{
String resp = "";
resp += PAGE_welcome0;
resp += cssColorString;
resp += PAGE_welcome1;
server.send(200, "text/html", resp);
}

Wyświetl plik

@ -2,6 +2,8 @@
* UDP notifier
*/
#define WLEDPACKETSIZE 24
void notify(uint8_t callMode)
{
if (!udpConnected) return;
@ -13,7 +15,7 @@ void notify(uint8_t callMode)
case 6: if (!notifyDirect) return; break; //fx change
default: return;
}
byte udpOut[16];
byte udpOut[WLEDPACKETSIZE];
udpOut[0] = 0; //0: wled notifier protocol 1: WARLS protocol
udpOut[1] = callMode;
udpOut[2] = bri;
@ -25,17 +27,18 @@ void notify(uint8_t callMode)
udpOut[8] = effectCurrent;
udpOut[9] = effectSpeed;
udpOut[10] = white;
udpOut[11] = 2; //compatibilityVersionByte: 0: old 1: supports white 2: supports secondary color
udpOut[11] = 3; //compatibilityVersionByte: 0: old 1: supports white 2: supports secondary color 3: supports FX intensity, 24 byte packet
udpOut[12] = col_sec[0];
udpOut[13] = col_sec[1];
udpOut[14] = col_sec[2];
udpOut[15] = white_sec;
udpOut[16] = effectIntensity;
IPAddress broadcastIp;
broadcastIp = ~WiFi.subnetMask() | WiFi.gatewayIP();
notifierUdp.beginPacket(broadcastIp, udpPort);
notifierUdp.write(udpOut, 16);
notifierUdp.write(udpOut, WLEDPACKETSIZE);
notifierUdp.endPacket();
}
@ -72,6 +75,11 @@ void handleNotifications()
effectSpeed = udpIn[9];
strip.setSpeed(effectSpeed);
}
if (udpIn[11] > 3 && udpIn[16] != effectIntensity)
{
effectSpeed = udpIn[16];
strip.setIntensity(effectIntensity);
}
nightlightActive = udpIn[6];
if (!nightlightActive)
{

Wyświetl plik

@ -0,0 +1,4 @@
/*
* Sync to Philips hue lights
*/
void foo(){}