Ledamp dropdown.

This commit is contained in:
Blaz Kristan 2022-02-10 23:14:48 +01:00
parent f8eece362f
commit 5c744ad9aa
5 changed files with 1646 additions and 1618 deletions

View File

@ -727,7 +727,7 @@ input[type=range]::-moz-range-thumb {
.sel {
margin: 5px 0 10px;
}
.sel-pl, .sel-ple {
.sel-p, .sel-pl, .sel-ple {
padding: 4px;
margin: 0;
font-size: 19px;
@ -748,6 +748,9 @@ input[type=range]::-moz-range-thumb {
.cl {
width: 42px;
}
.sel-p {
min-width: 3em;
}
.sel-pl {
width: 100%;
background-position: 141px 16px;

View File

@ -1613,7 +1613,7 @@ ${makePlSel(true)}
</select></div>
</div>
<div class="c"><button class="btn btn-p" onclick="testPl(${i}, this)"><i class='icons btn-icon'>&#xe139;</i>Test</button></div>`;
} else
} else {
content =
`<label class="check revchkl">
Include brightness
@ -1630,6 +1630,12 @@ ${makePlSel(true)}
<input type="checkbox" id="p${i}sbchk">
<span class="checkmark schk"></span>
</label>`;
if (Array.isArray(lastinfo.maps) && lastinfo.maps.length>0) {
content += `<div class="sel">Ledmap:&nbsp;<select class="sel sel-p" id="p${i}lmp"><option value="">None</option>`;
for (const k of (lastinfo.maps||[])) content += `<option value="${k}"${(i>0 && pJson[i].ledmap==k)?" selected":""}>${k}</option>`;
content += "</select></div>";
}
}
return `<input type="text" class="ptxt noslide" id="p${i}txt" autocomplete="off" maxlength=32 value="${(i>0)?pName(i):""}" placeholder="Enter name..."/>
<div class="c">Quick load label: <input type="text" class="stxt noslide" maxlength=2 value="${qlName(i)}" id="p${i}ql" autocomplete="off"/></div>
@ -1927,6 +1933,7 @@ function saveP(i,pl)
obj.ib = gId(`p${i}ibtgl`).checked;
obj.sb = gId(`p${i}sbtgl`).checked;
obj.sc = gId(`p${i}sbchk`).checked;
if (gId(`p${i}lmp`).value!=="") obj.ledmap = gId(`p${i}lmp`).value;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -555,6 +555,16 @@ void serializeInfo(JsonObject root)
root[F("fxcount")] = strip.getModeCount();
root[F("palcount")] = strip.getPaletteCount();
JsonArray ledmaps = root.createNestedArray(F("maps"));
for (uint8_t i=0; i<10; i++) {
char fileName[16];
strcpy_P(fileName, PSTR("/ledmap"));
if (i) sprintf(fileName +7, "%d", i);
strcat(fileName, ".json");
bool isFile = WLED_FS.exists(fileName);
if (isFile) ledmaps.add(i);
}
JsonObject wifi_info = root.createNestedObject("wifi");
wifi_info[F("bssid")] = WiFi.BSSIDstr();
int qrssi = WiFi.RSSI();

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2202091
#define VERSION 2202101
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG