mirror of
https://github.com/wled/WLED.git
synced 2025-07-22 10:16:32 +00:00
Finished RGBW HTML support
Version bump to 0.4pre
This commit is contained in:
parent
f878c89069
commit
f37f01c016
File diff suppressed because one or more lines are too long
@ -1,12 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||||
<title>WLED 0.3</title>
|
<title>WLED 0.4p</title>
|
||||||
<script>
|
<script>
|
||||||
strA = "";
|
strA = "";
|
||||||
strR = "";
|
strR = "";
|
||||||
strG = "";
|
strG = "";
|
||||||
strB = "";
|
strB = "";
|
||||||
|
strW = "";
|
||||||
strNL = "";
|
strNL = "";
|
||||||
strNR = "";
|
strNR = "";
|
||||||
strNS = "";
|
strNS = "";
|
||||||
@ -19,6 +20,7 @@
|
|||||||
var sto = false;
|
var sto = false;
|
||||||
var hsb = false;
|
var hsb = false;
|
||||||
var fxa = false;
|
var fxa = false;
|
||||||
|
var uwv = false;
|
||||||
var lastsx = 0;
|
var lastsx = 0;
|
||||||
|
|
||||||
function Startup()
|
function Startup()
|
||||||
@ -45,6 +47,14 @@
|
|||||||
document.Ctrl_form.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue;
|
document.Ctrl_form.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue;
|
||||||
document.Ctrl_form.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue;
|
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;
|
document.Ctrl_form.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue;
|
||||||
|
if (this.responseXML.getElementsByTagName('wv')[0].childNodes[0].nodeValue >= 0) {
|
||||||
|
document.Ctrl_form.SW.value = this.responseXML.getElementsByTagName('wv')[0].childNodes[0].nodeValue;
|
||||||
|
if (!uwv) document.getElementById("slW").style.display="block";
|
||||||
|
uwv = true;
|
||||||
|
} else {
|
||||||
|
document.getElementById("slW").style.display="none";
|
||||||
|
uwv = false;
|
||||||
|
}
|
||||||
if (document.activeElement != document.getElementById("fxI")) document.Ctrl_form.TF.value = this.responseXML.getElementsByTagName('fx')[0].childNodes[0].nodeValue;
|
if (document.activeElement != document.getElementById("fxI")) document.Ctrl_form.TF.value = this.responseXML.getElementsByTagName('fx')[0].childNodes[0].nodeValue;
|
||||||
document.Ctrl_form.SX.value = this.responseXML.getElementsByTagName('sx')[0].childNodes[0].nodeValue;
|
document.Ctrl_form.SX.value = this.responseXML.getElementsByTagName('sx')[0].childNodes[0].nodeValue;
|
||||||
nla = (this.responseXML.getElementsByTagName('nl')[0].innerHTML)!=0?true:false;
|
nla = (this.responseXML.getElementsByTagName('nl')[0].innerHTML)!=0?true:false;
|
||||||
@ -58,12 +68,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// send HTTP request
|
// send HTTP request
|
||||||
request.open("GET", "win/" + strA + strR + strG + strB + strNL + strNR + strNS + strMD + strFX + strSX +nocache, true);
|
request.open("GET", "win/" + strA + strR + strG + strB + strW + strNL + strNR + strNS + strMD + strFX + strSX +nocache, true);
|
||||||
request.send(null);
|
request.send(null);
|
||||||
strA = "";
|
strA = "";
|
||||||
strR = "";
|
strR = "";
|
||||||
strG = "";
|
strG = "";
|
||||||
strB = "";
|
strB = "";
|
||||||
|
strW = "";
|
||||||
strNL = "";
|
strNL = "";
|
||||||
strNR = "";
|
strNR = "";
|
||||||
strNS = "";
|
strNS = "";
|
||||||
@ -77,6 +88,7 @@
|
|||||||
strR = "&R=" + Ctrl_form.SR.value;
|
strR = "&R=" + Ctrl_form.SR.value;
|
||||||
strG = "&G=" + Ctrl_form.SG.value;
|
strG = "&G=" + Ctrl_form.SG.value;
|
||||||
strB = "&B=" + Ctrl_form.SB.value;
|
strB = "&B=" + Ctrl_form.SB.value;
|
||||||
|
if (uwv) strW = "&W=" + Ctrl_form.SW.value;
|
||||||
UpdateVals();
|
UpdateVals();
|
||||||
GetArduinoIO();
|
GetArduinoIO();
|
||||||
}
|
}
|
||||||
@ -144,7 +156,7 @@
|
|||||||
{
|
{
|
||||||
document.Ctrl_form.TF.value = parseInt(document.Ctrl_form.TF.value) +s;
|
document.Ctrl_form.TF.value = parseInt(document.Ctrl_form.TF.value) +s;
|
||||||
if (document.Ctrl_form.TF.value < 0) document.Ctrl_form.TF.value = 0;
|
if (document.Ctrl_form.TF.value < 0) document.Ctrl_form.TF.value = 0;
|
||||||
if (document.Ctrl_form.TF.value > 47) document.Ctrl_form.TF.value = 47;
|
if (document.Ctrl_form.TF.value > 52) document.Ctrl_form.TF.value = 52;
|
||||||
GetFX();
|
GetFX();
|
||||||
}
|
}
|
||||||
function SetFX()
|
function SetFX()
|
||||||
@ -157,6 +169,7 @@
|
|||||||
document.getElementById("slB").style.display="none";
|
document.getElementById("slB").style.display="none";
|
||||||
document.getElementById("slH").style.display="none";
|
document.getElementById("slH").style.display="none";
|
||||||
document.getElementById("slS").style.display="none";
|
document.getElementById("slS").style.display="none";
|
||||||
|
document.getElementById("slW").style.display="none";
|
||||||
document.getElementById("slX").style.display="block";
|
document.getElementById("slX").style.display="block";
|
||||||
document.getElementById("tlX").style.display="block";
|
document.getElementById("tlX").style.display="block";
|
||||||
} else {
|
} else {
|
||||||
@ -164,6 +177,7 @@
|
|||||||
document.getElementById("slA").style.display="block";
|
document.getElementById("slA").style.display="block";
|
||||||
document.getElementById("slX").style.display="none";
|
document.getElementById("slX").style.display="none";
|
||||||
document.getElementById("tlX").style.display="none";
|
document.getElementById("tlX").style.display="none";
|
||||||
|
if (uwv) document.getElementById("slW").style.display="block";
|
||||||
SetHSB();
|
SetHSB();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -363,6 +377,14 @@
|
|||||||
width: 77vw;
|
width: 77vw;
|
||||||
background: linear-gradient(to right, black, blue);
|
background: linear-gradient(to right, black, blue);
|
||||||
}
|
}
|
||||||
|
.sliderW {
|
||||||
|
display:none;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 2vh;
|
||||||
|
width: 77vw;
|
||||||
|
background: linear-gradient(to right, black, white);
|
||||||
|
}
|
||||||
.sliderH {
|
.sliderH {
|
||||||
display:none;
|
display:none;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@ -540,6 +562,8 @@
|
|||||||
<input type="range" title="Hue" class="sliders" name="SH" value="0" min="0" max="1" step="0.025" onchange="GetRGB()"> </div>
|
<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">
|
<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>
|
<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="tlX" class = "toolsFX">
|
||||||
<svg id="fmr" onclick="SwitchFX(-10)"><use xlink:href="#icon-backward2"></use></svg>
|
<svg id="fmr" onclick="SwitchFX(-10)"><use xlink:href="#icon-backward2"></use></svg>
|
||||||
<svg id="for" onclick="SwitchFX(-1)"><use xlink:href="#icon-circle-left"></use></svg>
|
<svg id="for" onclick="SwitchFX(-1)"><use xlink:href="#icon-circle-left"></use></svg>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -38,6 +38,7 @@
|
|||||||
document.S_form.CLDFG.value = this.responseXML.getElementsByTagName('cldef')[1].innerHTML;
|
document.S_form.CLDFG.value = this.responseXML.getElementsByTagName('cldef')[1].innerHTML;
|
||||||
document.S_form.CLDFB.value = this.responseXML.getElementsByTagName('cldef')[2].innerHTML;
|
document.S_form.CLDFB.value = this.responseXML.getElementsByTagName('cldef')[2].innerHTML;
|
||||||
document.S_form.CLDFA.value = this.responseXML.getElementsByTagName('cldfa')[0].innerHTML;
|
document.S_form.CLDFA.value = this.responseXML.getElementsByTagName('cldfa')[0].innerHTML;
|
||||||
|
document.S_form.CLDFW.value = this.responseXML.getElementsByTagName('cldfw')[0].innerHTML;
|
||||||
document.S_form.FXDEF.value = this.responseXML.getElementsByTagName('fxdef')[0].innerHTML;
|
document.S_form.FXDEF.value = this.responseXML.getElementsByTagName('fxdef')[0].innerHTML;
|
||||||
document.S_form.SXDEF.value = this.responseXML.getElementsByTagName('sxdef')[0].innerHTML;
|
document.S_form.SXDEF.value = this.responseXML.getElementsByTagName('sxdef')[0].innerHTML;
|
||||||
document.S_form.BOOTN.checked = (this.responseXML.getElementsByTagName('bootn')[0].innerHTML)!=0?true:false;
|
document.S_form.BOOTN.checked = (this.responseXML.getElementsByTagName('bootn')[0].innerHTML)!=0?true:false;
|
||||||
@ -127,6 +128,7 @@
|
|||||||
<input name="CLDFG" maxlength="3" size="2">
|
<input name="CLDFG" maxlength="3" size="2">
|
||||||
<input name="CLDFB" maxlength="3" size="2"> <br>
|
<input name="CLDFB" maxlength="3" size="2"> <br>
|
||||||
Default brightness: <input name="CLDFA" maxlength="3" size="2"> (0-255) <br>
|
Default brightness: <input name="CLDFA" maxlength="3" size="2"> (0-255) <br>
|
||||||
|
Default white value (only RGBW, -1 to disable): <input name="CLDFW" maxlength="3" size="2"> <br>
|
||||||
Default effect ID: <input name="FXDEF" maxlength="3" size="2"> <br>
|
Default effect ID: <input name="FXDEF" maxlength="3" size="2"> <br>
|
||||||
Default effect speed: <input name="SXDEF" maxlength="3" size="2"> <br>
|
Default effect speed: <input name="SXDEF" maxlength="3" size="2"> <br>
|
||||||
Ignore and use current color, brightness and effects: <input type="checkbox" name="CBEOR"> <br>
|
Ignore and use current color, brightness and effects: <input type="checkbox" name="CBEOR"> <br>
|
||||||
@ -152,9 +154,8 @@
|
|||||||
Emulate Alexa device: <input type="checkbox" name="ALEXA"> <br>
|
Emulate Alexa device: <input type="checkbox" name="ALEXA"> <br>
|
||||||
Alexa invocation name: <input name="AINVN" maxlength="32"><br>
|
Alexa invocation name: <input name="AINVN" maxlength="32"><br>
|
||||||
Send Alexa notifications: <input type="checkbox" name="NSALX"> <br>
|
Send Alexa notifications: <input type="checkbox" name="NSALX"> <br>
|
||||||
<h3>Time (highly experimental!)</h3>
|
<h3>Time (experimental!)</h3>
|
||||||
<b> Warning! </b>NTP was updated but still causes crashes. Requires reboot. <br>
|
NTP was updated but still causes crashes. Requires reboot. <br>
|
||||||
It is really not recommended to use this! <br>
|
|
||||||
Get time from NTP server: <input type="checkbox" name="NTPON"> <br>
|
Get time from NTP server: <input type="checkbox" name="NTPON"> <br>
|
||||||
Current local time is <span class="times">unknown</span> <br>
|
Current local time is <span class="times">unknown</span> <br>
|
||||||
<h3>Advanced</h3>
|
<h3>Advanced</h3>
|
||||||
@ -174,7 +175,7 @@
|
|||||||
|
|
||||||
HTTP traffic is not encrypted. An attacker in the same network could intercept form data!<br>
|
HTTP traffic is not encrypted. An attacker in the same network could intercept form data!<br>
|
||||||
<h3>About</h3>
|
<h3>About</h3>
|
||||||
WLED version 0.3 <br>
|
WLED version 0.4p <br>
|
||||||
(c) 2016-2017 Christian Schwinne <br>
|
(c) 2016-2017 Christian Schwinne <br>
|
||||||
<i>Licensed under the MIT license</i> <br>
|
<i>Licensed under the MIT license</i> <br>
|
||||||
<i>Uses libraries:</i> <br>
|
<i>Uses libraries:</i> <br>
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -20,7 +20,7 @@
|
|||||||
#include "CallbackFunction.h"
|
#include "CallbackFunction.h"
|
||||||
|
|
||||||
//version in format yymmddb (b = daily build)
|
//version in format yymmddb (b = daily build)
|
||||||
#define VERSION 1710120
|
#define VERSION 1710121
|
||||||
|
|
||||||
//uncomment if you have an RGBW strip
|
//uncomment if you have an RGBW strip
|
||||||
#define RGBW
|
#define RGBW
|
||||||
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @title WLED project sketch
|
* @title WLED project sketch
|
||||||
* @version 0.3
|
* @version 0.4p
|
||||||
* @author Christian Schwinne
|
* @author Christian Schwinne
|
||||||
*/
|
*/
|
||||||
//Hardware-settings (only changeble via code)
|
//Hardware-settings (only changeble via code)
|
||||||
@ -87,6 +87,7 @@ IPAddress staticsubnet(255, 255, 255, 0);
|
|||||||
boolean useHSB = false, useHSBDefault = false;
|
boolean useHSB = false, useHSBDefault = false;
|
||||||
boolean turnOnAtBoot = true;
|
boolean turnOnAtBoot = true;
|
||||||
byte col_s[]{255, 159, 0};
|
byte col_s[]{255, 159, 0};
|
||||||
|
boolean useRGBW = false;
|
||||||
byte white_s = 0;
|
byte white_s = 0;
|
||||||
byte bri_s = 127;
|
byte bri_s = 127;
|
||||||
uint8_t bri_nl = 0, bri_nls;
|
uint8_t bri_nl = 0, bri_nls;
|
||||||
|
@ -102,6 +102,7 @@ void saveSettingsToEEPROM()
|
|||||||
EEPROM.write(369, turnOnAtBoot);
|
EEPROM.write(369, turnOnAtBoot);
|
||||||
EEPROM.write(370, useHSBDefault);
|
EEPROM.write(370, useHSBDefault);
|
||||||
EEPROM.write(371, white_s);
|
EEPROM.write(371, white_s);
|
||||||
|
EEPROM.write(372, useRGBW);
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,5 +215,6 @@ void loadSettingsFromEEPROM()
|
|||||||
turnOnAtBoot = EEPROM.read(369);
|
turnOnAtBoot = EEPROM.read(369);
|
||||||
useHSBDefault = EEPROM.read(370);
|
useHSBDefault = EEPROM.read(370);
|
||||||
white_s = EEPROM.read(371);
|
white_s = EEPROM.read(371);
|
||||||
|
useRGBW = EEPROM.read(372);
|
||||||
useHSB = useHSBDefault;
|
useHSB = useHSBDefault;
|
||||||
}
|
}
|
||||||
|
@ -34,11 +34,11 @@ void XML_response()
|
|||||||
resp = resp + "</fx><sx>";
|
resp = resp + "</fx><sx>";
|
||||||
resp = resp + effectSpeed;
|
resp = resp + effectSpeed;
|
||||||
resp = resp + "</sx><wv>";
|
resp = resp + "</sx><wv>";
|
||||||
#ifdef RGBW
|
if (useRGBW) {
|
||||||
resp = resp + white;
|
resp = resp + white;
|
||||||
#else
|
} else {
|
||||||
resp = resp + "-1";
|
resp = resp + "-1";
|
||||||
#endif
|
}
|
||||||
resp = resp + "</wv><md>";
|
resp = resp + "</wv><md>";
|
||||||
resp = resp + useHSB;
|
resp = resp + useHSB;
|
||||||
resp = resp + "</md><desc>";
|
resp = resp + "</md><desc>";
|
||||||
@ -116,7 +116,11 @@ void XML_response_settings()
|
|||||||
resp = resp + "</cldef>";
|
resp = resp + "</cldef>";
|
||||||
}
|
}
|
||||||
resp = resp + "<cldfw>";
|
resp = resp + "<cldfw>";
|
||||||
resp = resp + white_s;
|
if (useRGBW) {
|
||||||
|
resp = resp + white_s;
|
||||||
|
} else {
|
||||||
|
resp = resp + "-1";
|
||||||
|
}
|
||||||
resp = resp + "</cldfw><cldfa>";
|
resp = resp + "</cldfw><cldfa>";
|
||||||
resp = resp + bri_s;
|
resp = resp + bri_s;
|
||||||
resp = resp + "</cldfa>";
|
resp = resp + "</cldfa>";
|
||||||
@ -218,7 +222,7 @@ void XML_response_settings()
|
|||||||
resp = resp + "Not active";
|
resp = resp + "Not active";
|
||||||
}
|
}
|
||||||
resp = resp + "</sip>";
|
resp = resp + "</sip>";
|
||||||
resp = resp + "<msg>WLED 0.3 (build ";
|
resp = resp + "<msg>WLED 0.4p (build ";
|
||||||
resp = resp + VERSION;
|
resp = resp + VERSION;
|
||||||
resp = resp + ") OK</msg>";
|
resp = resp + ") OK</msg>";
|
||||||
resp = resp + "</vs>";
|
resp = resp + "</vs>";
|
||||||
|
@ -133,7 +133,14 @@ void handleSettingsSet()
|
|||||||
if (server.hasArg("CLDFW"))
|
if (server.hasArg("CLDFW"))
|
||||||
{
|
{
|
||||||
int i = server.arg("CLDFW").toInt();
|
int i = server.arg("CLDFW").toInt();
|
||||||
if (i >= 0 && i <= 255) white_s = i;
|
if (i >= 0 && i <= 255)
|
||||||
|
{
|
||||||
|
useRGBW = true;
|
||||||
|
white_s = i;
|
||||||
|
} else {
|
||||||
|
useRGBW = false;
|
||||||
|
white_s = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (server.hasArg("CLDFA"))
|
if (server.hasArg("CLDFA"))
|
||||||
{
|
{
|
||||||
|
@ -90,6 +90,12 @@ void wledInit()
|
|||||||
server.on("/version", HTTP_GET, [](){
|
server.on("/version", HTTP_GET, [](){
|
||||||
server.send(200, "text/plain", (String)VERSION);
|
server.send(200, "text/plain", (String)VERSION);
|
||||||
});
|
});
|
||||||
|
server.on("/uptime", HTTP_GET, [](){
|
||||||
|
server.send(200, "text/plain", (String)millis());
|
||||||
|
});
|
||||||
|
server.on("/freeheap", HTTP_GET, [](){
|
||||||
|
server.send(200, "text/plain", (String)ESP.getFreeHeap());
|
||||||
|
});
|
||||||
if (!ota_lock){
|
if (!ota_lock){
|
||||||
server.on("/edit", HTTP_GET, [](){
|
server.on("/edit", HTTP_GET, [](){
|
||||||
if(!handleFileRead("/edit.htm")) server.send(200, "text/html", PAGE_edit);
|
if(!handleFileRead("/edit.htm")) server.send(200, "text/html", PAGE_edit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user