diff --git a/wled00/data/index.js b/wled00/data/index.js index 44ae0038..cc198094 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -156,6 +156,20 @@ function loadBg(iUrl) [2023,3,9,2,"https://aircoookie.github.io/easter.png"], [2024,2,31,2,"https://aircoookie.github.io/easter.png"] ]; + fetch("./holidays.json", { + method: 'get' + }) + .then(res => { + //if (!res.ok) showErrorToast(); + return res.json(); + }) + .then(json => { + if (Array.isArray(json)) hol = json; + //TODO: do some parsing first + }) + .catch(function (error) { + console.log("holidays.json does not contain array of holidays."); + }); for (var i=0; ie==parseInt(LCs[i].value,10))) {alert(`Sorry, pins ${JSON.stringify(d.um_p)} can't be used.`);LCs[i].value="";LCs[i].focus();return false;} else if (LCs[i].value > 5 && LCs[i].value < 12) {alert("Sorry, pins 6-11 can not be used.");LCs[i].value="";LCs[i].focus();return false;} + else if (!(nm == "IR" || nm=="BT") && LCs[i].value > 33) {alert("Sorry, pins >33 are input only.");LCs[i].value="";LCs[i].focus();return false;} for (j=i+1; j 49) ? "Data:" : (type >41) ? "Pins:" : "Pin:"; - gId("p1d"+n).innerHTML = (type > 49) ? "Clk:" : ""; + gId("p0d"+n).innerHTML = (type > 49) ? "Data GPIO:" : (type >41) ? "GPIOs:" : "GPIO:"; + gId("p1d"+n).innerHTML = (type > 49) ? "Clk GPIO:" : ""; var LK = d.getElementsByName("L1"+n)[0]; // clock pin memu += getMem(type, d.getElementsByName("LC"+n)[0].value, d.getElementsByName("L0"+n)[0].value); // calc memory @@ -146,8 +147,6 @@ LK.value=""; } } -// gId("ls"+n).readOnly = !(type > 31 && type < 48); // if analog, allow editing LED start -// gId("LC").readOnly = !(type > 31 && type < 48); // if analog, allow editing total LED count if (change) { // gId("ew"+n).checked = (type == 30 || type == 31 || type == 44 || type == 45); // RGBW checkbox, TYPE_xxxx values from const.h gId("ls"+n).value = n+1; // set LED start @@ -185,18 +184,18 @@ lc.max=maxPB; // update max led count value } // for pins check conflicts - if (nm=="L0" || nm=="L1" || nm=="L2" || nm=="L3" || nm=="L4" || nm=="RL" || nm=="BT" || nm=="IR") + if (nm=="L0" || nm=="L1" || nm=="L2" || nm=="L3" || nm=="L4" || nm=="L5" || nm=="L6" || nm=="L7" || nm=="RL" || nm=="BT" || nm=="IR") if (LCs[i].value!="" && LCs[i].value!="-1") { var p = []; // used pin array if (d.um_p && Array.isArray(d.um_p)) for (k=0;ke==parseInt(LCs[i].value,10))) LCs[i].style.color="red"; else LCs[i].style.color="#fff"; + if (p.some((e)=>e==parseInt(LCs[i].value,10))) LCs[i].style.color="red"; else LCs[i].style.color=parseInt(LCs[i].value,10)>33?"orange":"#fff"; } } // update total led count @@ -213,7 +212,7 @@ gId('dbar').style.background = `linear-gradient(90deg, ${bquot > 60 ? (bquot > 90 ? "red":"orange"):"#ccc"} 0 ${bquot}%%, #444 ${bquot}%% 100%%)`; gId('ledwarning').style.display = (sLC > maxPB || maxLC > 800 || bquot > 80) ? 'inline':'none'; gId('ledwarning').style.color = (sLC > maxPB || maxLC > maxPB || bquot > 100) ? 'red':'orange'; - gId('wreason').innerHTML = (bquot > 80) ? "80% of max. LED memory" +(bquot>100 ? ` (WARNING: Using over ${maxM}B!)` : "") : "800 LEDs per pin"; + gId('wreason').innerHTML = (bquot > 80) ? "80% of max. LED memory" +(bquot>100 ? ` (WARNING: Using over ${maxM}B!)` : "") : "800 LEDs per GPIO"; // calculate power var val = Math.ceil((100 + sLC * laprev)/500)/2; val = (val > 5) ? Math.ceil(val) : val; @@ -283,11 +282,11 @@ Color Order:
-Pin: -Clock: - - - +GPIO: + + + +
Start:  
@@ -311,7 +310,7 @@ Reverse (rotated 180°): var c = gId("btns").innerHTML; var bt = "BT" + i; var be = "BE" + i; - c += `Button ${i} pin: `; + c += `Button ${i} GPIO: `; c += ` function GetV() { //values injected by server while sending HTML - //maxM=5000;maxPB=1536;d.um_p=[1,6,7,8,9,10,11];addLEDs(3);d.Sf.LC.value=250;addLEDs(1);d.Sf.L00.value=2;d.Sf.L10.value=0;d.Sf.LC0.value=250;d.Sf.LT0.value=22;d.Sf.CO0.value=0;d.Sf.LS0.value=0;d.Sf.LS0.checked=0;d.Sf.MA.value=5400;d.Sf.LA.value=55;d.getElementsByClassName("pow")[0].innerHTML="350mA";d.Sf.CA.value=40;d.Sf.AW.value=3;d.Sf.BO.checked=0;d.Sf.BP.value=3;d.Sf.GB.checked=0;d.Sf.GC.checked=1;d.Sf.TF.checked=1;d.Sf.TD.value=700;d.Sf.PF.checked=0;d.Sf.BF.value=64;d.Sf.TB.value=0;d.Sf.TL.value=60;d.Sf.TW.value=1;d.Sf.PB.selectedIndex=0;d.Sf.RL.value=12;d.Sf.RM.checked=0;addBtn(0,0,2);addBtn(1,3,4);addBtn(2,-1,0);d.Sf.IR.value=-1; + //maxM=5000;maxPB=1536;d.um_p=[1,6,7,8,9,10,11];addLEDs(5);d.Sf.LC.value=250;addLEDs(1);d.Sf.L00.value=2;d.Sf.L10.value=0;d.Sf.LC0.value=250;d.Sf.LT0.value=22;d.Sf.CO0.value=0;d.Sf.LS0.value=0;d.Sf.LS0.checked=0;d.Sf.MA.value=5400;d.Sf.LA.value=55;d.getElementsByClassName("pow")[0].innerHTML="350mA";d.Sf.CA.value=40;d.Sf.AW.value=3;d.Sf.BO.checked=0;d.Sf.BP.value=3;d.Sf.GB.checked=0;d.Sf.GC.checked=1;d.Sf.TF.checked=1;d.Sf.TD.value=700;d.Sf.PF.checked=0;d.Sf.BF.value=64;d.Sf.TB.value=0;d.Sf.TL.value=60;d.Sf.TW.value=1;d.Sf.PB.selectedIndex=0;d.Sf.RL.value=12;d.Sf.RM.checked=0;addBtn(0,0,2);addBtn(1,3,4);addBtn(2,-1,0);d.Sf.IR.value=-1; } - + @@ -393,7 +392,7 @@ Reverse (rotated 180°):

Touch threshold:
- IR pin:
IR info
- Relay pin: invert  ×
+ Relay pin: invert  ×

Defaults

Turn LEDs on after power up/reset:
diff --git a/wled00/data/settings_time.htm b/wled00/data/settings_time.htm index 38c10f0d..f8e4615e 100644 --- a/wled00/data/settings_time.htm +++ b/wled00/data/settings_time.htm @@ -46,13 +46,13 @@ var ih="ActiveHourMinutePresetMTWTFSS"; for (i=0;i<8;i++) { - ih+=""; + ih+=""; for (j=1;j<8;j++) ih+=""; ih+=""; } - ih+="Sunrise"; + ih+="Sunrise"; for (j=1;j<8;j++) ih+=""; - ih+="Sunset"; + ih+="Sunset"; for (j=1;j<8;j++) ih+=""; ih+=""; gId("TMT").innerHTML=ih; @@ -86,11 +86,11 @@ td = tr.insertCell(0); td.innerHTML = `Button ${i}:`; td = tr.insertCell(1); - td.innerHTML = ``; + td.innerHTML = ``; td = tr.insertCell(2); - td.innerHTML = ``; + td.innerHTML = ``; td = tr.insertCell(3); - td.innerHTML = ``; + td.innerHTML = ``; } function GetV() { diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index b0f46d48..8cc33fe3 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -73,26 +73,22 @@ addField(k,f,o[j],true); } } else { - var t,c; - switch (typeof o) { + var c, t = typeof o; + switch (t) { case "boolean": - t = "checkbox"; c = o ? `checked value="true"` : ""; + t = "checkbox"; c = 'value="true"' + (o ? ' checked' : ''); break; case "number": c = `value="${o}"`; - if (isF(o)) { - c += ` step="0.01" class="xxl"`; - t = "float"; - } else { - if (f.substr(-3)==="pin") c += ' max="39" min="-1" class="small"'; - else c += ` class="big"`; + if (f.substr(-3)==="pin") { + c += ' max="39" min="-1" class="sml"'; t = "int"; + } else { + c += ' step="0.00001" class="xxl"'; } break; -// case "string": -// t = "text"; c = `value="${o}" style="width:150px;"`; break; default: - t = "text"; c = `value="${o}" style="width:150px;"`; + t = "text"; c = `value="${o}" style="width:250px;"`; break; } if (k.includes(":")) urows += k.substr(k.indexOf(":")+1); @@ -100,7 +96,7 @@ // https://stackoverflow.com/questions/11657123/posting-both-checked-and-unchecked-checkboxes if (t=="checkbox") urows += ``; else if (!a) urows += ``; - urows += `
`; + urows += `
`; } } function ldS() { diff --git a/wled00/data/style.css b/wled00/data/style.css index 773031a9..46c9dc8c 100644 --- a/wled00/data/style.css +++ b/wled00/data/style.css @@ -56,7 +56,7 @@ input[type="number"].big { input[type="number"].med { width: 55px; } -input[type="number"].small { +input[type="number"].sml { width: 40px; } select { diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 1c75cdc3..b97ccfbe 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!! @@ -75,7 +75,7 @@ onclick="B()">Back // Autogenerated from wled00/data/settings_leds.htm, do not edit!! const char PAGE_settings_leds[] PROGMEM = R"=====(LED Settings