Skip to content

Commit

Permalink
Added Preset ID quick display option
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Dec 14, 2020
1 parent faa4e77 commit c53647c
Show file tree
Hide file tree
Showing 10 changed files with 1,655 additions and 1,631 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

### Development versions after 0.11.0 release

#### Build 2012140

- Added Preset ID quick display option (PR #1462)
- Fixed LEDs not turning on when using gamma correct brightness and LEDPIN 2 (default)
- Fixed notifier applying main segment to selected segments on notification with FX/Col disabled

#### Build 2012130

- Fixed RGBW mode not saved between reboots (fixes #1457)
- Added brightness scaling in palette function for default (PR #1484)
-

#### Build 2012101

Expand Down
8 changes: 4 additions & 4 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,17 +404,17 @@ void WS2812FX::setColor(uint8_t slot, uint32_t c) {
}

void WS2812FX::setBrightness(uint8_t b) {
if (gammaCorrectBri) b = gamma8(b);
if (_brightness == b) return;
_brightness = (gammaCorrectBri) ? gamma8(b) : b;
_brightness = b;
_segment_index = 0;
if (b == 0) { //unfreeze all segments on power off
if (_brightness == 0) { //unfreeze all segments on power off
for (uint8_t i = 0; i < MAX_NUM_SEGMENTS; i++)
{
_segments[i].setOption(SEG_OPTION_FREEZE, false);
}
#if LEDPIN == LED_BUILTIN
if (!shouldStartBus)
shouldStartBus = true;
shouldStartBus = true;
#endif
} else {
#if LEDPIN == LED_BUILTIN
Expand Down
2 changes: 1 addition & 1 deletion wled00/NpbWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//This can be useful if you want to chain multiple strings with incompatible color order
//#define COLOR_ORDER_OVERRIDE
#define COO_MIN 0
#define COO_MAX 27 //not inclusive, this would set the override for LEDs 0-26
#define COO_MAX 35 //not inclusive, this would set the override for LEDs 0-26
#define COO_ORDER COL_ORDER_GRB

//END CONFIGURATION
Expand Down
12 changes: 6 additions & 6 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,11 @@
text-overflow: clip;
}

.segid {
.pid {
position: absolute;
top: 0px;
left: 0px;
padding: 10px 0px 0px 12px;
padding: 11px 0px 0px 11px;
font-size: 16px;
width: 20px;
text-align: center;
Expand Down Expand Up @@ -1164,7 +1164,7 @@
var lastinfo = {};
var cfg = {
theme:{base:"dark", bg:{url:""}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}},
comp :{colors:{picker: true, rgb: false, quick: true, hex: false}, labels:true, pcmbot:false}
comp :{colors:{picker: true, rgb: false, quick: true, hex: false}, labels:true, pcmbot:false, pid:true}
};

var cpick = new iro.ColorPicker("#picker", {
Expand Down Expand Up @@ -1559,9 +1559,9 @@
if (qll) pQL.push([i, qll]);
is.push(i);

cn += `<div class="seg pres" id="p${i}o">
<div class="segid">${i}</div>
<div class="segname pname" onclick="setPreset(${i})">${pName(i)}</div>
cn += `<div class="seg pres" id="p${i}o">`;
if (cfg.comp.pid) cn += `<div class="pid">${i}</div>`;
cn += `<div class="segname pname" onclick="setPreset(${i})">${pName(i)}</div>
<i class="icons e-icon flr ${expanded[i+100] ? "exp":""}" id="sege${i+100}" onclick="expand(${i+100})">&#xe395;</i>
<div class="segin" id="seg${i+100}"></div>
</div><br>`;
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/settings_sync.htm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3>WLED Broadcast</h3>
2nd Port: <input name="U2" type="number" min="1" max="65535" class="d5" required><br>
Receive <input type="checkbox" name="RB">Brightness, <input type="checkbox" name="RC">Color, and <input type="checkbox" name="RX">Effects<br>
Send notifications on direct change: <input type="checkbox" name="SD"><br>
Send notifications on button press: <input type="checkbox" name="SB"><br>
Send notifications on button press or IR: <input type="checkbox" name="SB"><br>
Send Alexa notifications: <input type="checkbox" name="SA"><br>
Send Philips Hue change notifications: <input type="checkbox" name="SH"><br>
Send Macro notifications: <input type="checkbox" name="SM"><br>
Expand Down
6 changes: 4 additions & 2 deletions wled00/data/settings_ui.htm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"quick": "Quick color selectors",
"hex": "HEX color input"
},
"pcmbot": "Show bottom tab bar in PC mode"
"pcmbot": "Show bottom tab bar in PC mode",
"pid": "Show preset IDs"
},
"theme":{
"alpha": {
Expand Down Expand Up @@ -189,7 +190,8 @@ <h2>Web Setup</h2>

<h3>UI Appearance</h3>
<span class="l"></span>: <input type="checkbox" id="comp_labels" class="agi cb"><br>
<span class="l"></span>: <input type="checkbox" id="comp_pcmbot" class="agi cb"><br>
<span class="l"></span>: <input type="checkbox" id="comp_pcmbot" class="agi cb"><br>
<span class="l"></span>: <input type="checkbox" id="comp_pid" class="agi cb"><br>
I hate dark mode: <input type="checkbox" id="dm" onchange="UI()"><br>
<span id="idonthateyou" style="display:none"><i>Why would you? </i>&#x1F97A;<br></span>
<span class="l"></span>: <input type="number" min=0.0 max=1.0 step=0.01 id="theme_alpha_tab" class="agi"><br>
Expand Down
17 changes: 9 additions & 8 deletions wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const char PAGE_settings_dmx[] PROGMEM = R"=====()=====";
// Autogenerated from wled00/data/settings_ui.htm, do not edit!!
const char PAGE_settings_ui[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport"
content="width=500"><title>UI Settings</title><script>
var initial_ds,initial_st,d=document,sett=null,l={comp:{labels:"Show button labels",colors:{LABEL:"Color selection methods",picker:"Color Wheel",rgb:"RGB sliders",quick:"Quick color selectors",hex:"HEX color input"},pcmbot:"Show bottom tab bar in PC mode"},theme:{alpha:{bg:"Background opacity",tab:"Button opacity"},bg:{url:"BG image URL"},color:{bg:"BG HEX color"}}};function gId(e){return d.getElementById(e)}function isObject(e){return e&&"object"==typeof e&&!Array.isArray(e)}function set(e,i,t){for(var n=i,l=e.split("_"),s=l.length,o=0;o<s-1;o++){var a=l[o];n[a]||(n[a]={}),n=n[a]}n[l[s-1]]=t}function addRec(e,t="",n=null){var l="";for(i in e){var s=t+(t?"_":"")+i;if(isObject(e[i]))n&&n[i]&&n[i].LABEL&&(l+=`<h3>${n[i].LABEL}</h3>`),l+=addRec(e[i],s,n?n[i]:null);else{var o=s;if(n&&n[i]?o=n[i]:e[i+"LABEL"]&&(o=e[i+"LABEL"]),i.indexOf("LABEL")>0)continue;var a=typeof e[i];gId(s)?("boolean"===a?gId(s).checked=e[i]:gId(s).value=e[i],gId(s).previousElementSibling.matches(".l")&&(gId(s).previousElementSibling.innerHTML=o)):"boolean"===a?l+=`${o}: <input class="agi cb" type="checkbox" id=${s} ${e[i]?"checked":""}><br>`:"number"===a?l+=`${o}: <input class="agi" type="number" id=${s} value=${e[i]}><br>`:"string"===a&&(l+=`${o}:<br><input class="agi" id=${s} value=${e[i]}><br>`)}}return l}function genForm(e){var i;i=addRec(e,"",l),gId("gen").innerHTML=i}function GetLS(){(sett=localStorage.getItem("wledUiCfg"))||(gId("lserr").style.display="inline");try{sett=JSON.parse(sett)}catch(e){sett={},gId("lserr").style.display="inline",gId("lserr").innerHTML="&#9888; Settings JSON parsing failed. ("+e+")"}genForm(sett),gId("dm").checked="light"===gId("theme_base").value}function SetLS(){for(var e=d.querySelectorAll(".agi"),i=0;i<e.length;i++){var t=e[i],n=t.classList.contains("cb")?t.checked:t.value;set(t.id,sett,n),console.log(`${t.id} set to ${n}`)}try{localStorage.setItem("wledUiCfg",JSON.stringify(sett)),gId("lssuc").style.display="inline"}catch(t){gId("lssuc").style.display="none",gId("lserr").style.display="inline",gId("lserr").innerHTML="&#9888; Settings JSON saving failed. ("+t+")"}}function Save(){SetLS(),d.Sf.DS.value==initial_ds&&d.Sf.ST.checked==initial_st||d.Sf.submit()}function S(){GetV(),initial_ds=d.Sf.DS.value,initial_st=d.Sf.ST.checked,GetLS()}function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#user-interface-settings")}function B(){window.open("/settings","_self")}function UI(){gId("idonthateyou").style.display=gId("dm").checked?"inline":"none";var e=gId("theme_base");e&&(e.value=gId("dm").checked?"light":"dark")}function GetV() {var d=document;
var initial_ds,initial_st,d=document,sett=null,l={comp:{labels:"Show button labels",colors:{LABEL:"Color selection methods",picker:"Color Wheel",rgb:"RGB sliders",quick:"Quick color selectors",hex:"HEX color input"},pcmbot:"Show bottom tab bar in PC mode",pid:"Show preset IDs"},theme:{alpha:{bg:"Background opacity",tab:"Button opacity"},bg:{url:"BG image URL"},color:{bg:"BG HEX color"}}};function gId(e){return d.getElementById(e)}function isObject(e){return e&&"object"==typeof e&&!Array.isArray(e)}function set(e,i,t){for(var n=i,l=e.split("_"),s=l.length,o=0;o<s-1;o++){var r=l[o];n[r]||(n[r]={}),n=n[r]}n[l[s-1]]=t}function addRec(e,t="",n=null){var l="";for(i in e){var s=t+(t?"_":"")+i;if(isObject(e[i]))n&&n[i]&&n[i].LABEL&&(l+=`<h3>${n[i].LABEL}</h3>`),l+=addRec(e[i],s,n?n[i]:null);else{var o=s;if(n&&n[i]?o=n[i]:e[i+"LABEL"]&&(o=e[i+"LABEL"]),i.indexOf("LABEL")>0)continue;var r=typeof e[i];gId(s)?("boolean"===r?gId(s).checked=e[i]:gId(s).value=e[i],gId(s).previousElementSibling.matches(".l")&&(gId(s).previousElementSibling.innerHTML=o)):"boolean"===r?l+=`${o}: <input class="agi cb" type="checkbox" id=${s} ${e[i]?"checked":""}><br>`:"number"===r?l+=`${o}: <input class="agi" type="number" id=${s} value=${e[i]}><br>`:"string"===r&&(l+=`${o}:<br><input class="agi" id=${s} value=${e[i]}><br>`)}}return l}function genForm(e){var i;i=addRec(e,"",l),gId("gen").innerHTML=i}function GetLS(){(sett=localStorage.getItem("wledUiCfg"))||(gId("lserr").style.display="inline");try{sett=JSON.parse(sett)}catch(e){sett={},gId("lserr").style.display="inline",gId("lserr").innerHTML="&#9888; Settings JSON parsing failed. ("+e+")"}genForm(sett),gId("dm").checked="light"===gId("theme_base").value}function SetLS(){for(var e=d.querySelectorAll(".agi"),i=0;i<e.length;i++){var t=e[i],n=t.classList.contains("cb")?t.checked:t.value;set(t.id,sett,n),console.log(`${t.id} set to ${n}`)}try{localStorage.setItem("wledUiCfg",JSON.stringify(sett)),gId("lssuc").style.display="inline"}catch(t){gId("lssuc").style.display="none",gId("lserr").style.display="inline",gId("lserr").innerHTML="&#9888; Settings JSON saving failed. ("+t+")"}}function Save(){SetLS(),d.Sf.DS.value==initial_ds&&d.Sf.ST.checked==initial_st||d.Sf.submit()}function S(){GetV(),initial_ds=d.Sf.DS.value,initial_st=d.Sf.ST.checked,GetLS()}function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#user-interface-settings")}function B(){window.open("/settings","_self")}function UI(){gId("idonthateyou").style.display=gId("dm").checked?"inline":"none";var e=gId("theme_base");e&&(e.value=gId("dm").checked?"light":"dark")}function GetV() {var d=document;
%CSS%%SCSS%</head><body onload="S()"><form
id="form_s" name="Sf" method="post"><div
style="position:sticky;top:0;background-color:#222"><div class="helpB"><button
Expand All @@ -185,12 +185,13 @@ You will need to set them again if using a different browser, device or WLED IP
<br>Refresh the main UI to apply changes.</i><br><div id="gen">
Loading settings...</div><h3>UI Appearance</h3><span class="l"></span>: <input
type="checkbox" id="comp_labels" class="agi cb"><br><span class="l"></span>:
<input type="checkbox" id="comp_pcmbot" class="agi cb"><br>I hate dark mode:
<input type="checkbox" id="dm" onchange="UI()"><br><span id="idonthateyou"
style="display:none"><i>Why would you? </i>&#x1F97A;<br></span><span class="l">
</span>: <input type="number" min="0.0" max="1.0" step="0.01"
id="theme_alpha_tab" class="agi"><br><span class="l"></span>: <input
type="number" min="0.0" max="1.0" step="0.01" id="theme_alpha_bg" class="agi">
<input type="checkbox" id="comp_pcmbot" class="agi cb"><br><span class="l">
</span>: <input type="checkbox" id="comp_pid" class="agi cb"><br>
I hate dark mode: <input type="checkbox" id="dm" onchange="UI()"><br><span
id="idonthateyou" style="display:none"><i>Why would you? </i>&#x1F97A;<br>
</span><span class="l"></span>: <input type="number" min="0.0" max="1.0"
step="0.01" id="theme_alpha_tab" class="agi"><br><span class="l"></span>: <input
type="number" min="0.0" max="1.0" step="0.01" id="theme_alpha_bg" class="agi">
<br><span class="l"></span>: <input id="theme_color_bg" maxlength="9"
class="agi"><br><span class="l">BG image URL</span>: <input id="theme_bg_url"
class="agi"> <input id="theme_base" class="agi" style="display:none"><hr><button
Expand Down Expand Up @@ -219,7 +220,7 @@ type="number" min="1" max="65535" class="d5" required><br>Receive <input
type="checkbox" name="RB">Brightness, <input type="checkbox" name="RC">
Color, and <input type="checkbox" name="RX">Effects<br>
Send notifications on direct change: <input type="checkbox" name="SD"><br>
Send notifications on button press: <input type="checkbox" name="SB"><br>
Send notifications on button press or IR: <input type="checkbox" name="SB"><br>
Send Alexa notifications: <input type="checkbox" name="SA"><br>
Send Philips Hue change notifications: <input type="checkbox" name="SH"><br>
Send Macro notifications: <input type="checkbox" name="SM"><br>
Expand Down
Loading

0 comments on commit c53647c

Please sign in to comment.