2016-12-31 00:38:51 +01:00
|
|
|
/*
|
|
|
|
* Sending XML status files to client
|
|
|
|
*/
|
|
|
|
|
2018-11-09 17:00:36 +01:00
|
|
|
//build XML response to HTTP /win API request
|
2019-03-16 02:09:37 +01:00
|
|
|
char* XML_response(AsyncWebServerRequest *request, bool includeTheme, char* dest = nullptr)
|
2016-11-19 19:39:17 +01:00
|
|
|
{
|
2019-03-16 02:09:37 +01:00
|
|
|
if (dest == nullptr) //allocate local buffer if none passed
|
|
|
|
{
|
|
|
|
char sbuf[1024];
|
|
|
|
obuf = sbuf;
|
|
|
|
} else {
|
|
|
|
obuf = dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
olen = 0;
|
2019-03-09 21:41:23 +01:00
|
|
|
oappend("<?xml version=\"1.0\" ?><vs><ac>");
|
2018-11-09 17:00:36 +01:00
|
|
|
oappendi((nightlightActive && nightlightFade) ? briT : bri);
|
|
|
|
oappend("</ac>");
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
oappend("<cl>");
|
|
|
|
oappendi(col[i]);
|
|
|
|
oappend("</cl>");
|
|
|
|
}
|
2019-01-18 01:20:36 +01:00
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
oappend("<cs>");
|
|
|
|
oappendi(colSec[i]);
|
|
|
|
oappend("</cs>");
|
|
|
|
}
|
2018-11-09 17:00:36 +01:00
|
|
|
oappend("<ns>");
|
|
|
|
oappendi(notifyDirect);
|
|
|
|
oappend("</ns><nr>");
|
|
|
|
oappendi(receiveNotifications);
|
|
|
|
oappend("</nr><nl>");
|
|
|
|
oappendi(nightlightActive);
|
|
|
|
oappend("</nl><nf>");
|
|
|
|
oappendi(nightlightFade);
|
|
|
|
oappend("</nf><nd>");
|
|
|
|
oappendi(nightlightDelayMins);
|
|
|
|
oappend("</nd><nt>");
|
|
|
|
oappendi(nightlightTargetBri);
|
|
|
|
oappend("</nt><fx>");
|
|
|
|
oappendi(effectCurrent);
|
|
|
|
oappend("</fx><sx>");
|
|
|
|
oappendi(effectSpeed);
|
|
|
|
oappend("</sx><ix>");
|
|
|
|
oappendi(effectIntensity);
|
|
|
|
oappend("</ix><fp>");
|
|
|
|
oappendi(effectPalette);
|
|
|
|
oappend("</fp><wv>");
|
|
|
|
if (useRGBW && !autoRGBtoRGBW) {
|
2019-02-05 21:53:39 +01:00
|
|
|
oappendi(col[3]);
|
2018-11-09 17:00:36 +01:00
|
|
|
} else {
|
|
|
|
oappend("-1");
|
|
|
|
}
|
2019-01-18 01:20:36 +01:00
|
|
|
oappend("</wv><ws>");
|
2019-02-05 21:53:39 +01:00
|
|
|
oappendi(colSec[3]);
|
2019-01-18 01:20:36 +01:00
|
|
|
oappend("</ws><md>");
|
2018-11-09 17:00:36 +01:00
|
|
|
oappendi(useHSB);
|
2019-02-05 19:40:24 +01:00
|
|
|
oappend("</md><cy>");
|
|
|
|
oappendi(presetCyclingEnabled);
|
|
|
|
oappend("</cy><ds>");
|
2019-02-19 12:57:50 +01:00
|
|
|
if (realtimeActive)
|
|
|
|
{
|
|
|
|
String mesg = "Live ";
|
|
|
|
if (realtimeIP[0] == 0)
|
|
|
|
{
|
|
|
|
mesg += "E1.31 mode";
|
|
|
|
} else {
|
|
|
|
mesg += "UDP from ";
|
|
|
|
mesg += realtimeIP[0];
|
|
|
|
for (int i = 1; i < 4; i++)
|
|
|
|
{
|
|
|
|
mesg += ".";
|
|
|
|
mesg += realtimeIP[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
oappend((char*)mesg.c_str());
|
|
|
|
} else {
|
|
|
|
oappend(serverDescription);
|
|
|
|
}
|
|
|
|
|
2018-11-16 19:59:00 +01:00
|
|
|
oappend("</ds>");
|
|
|
|
if (includeTheme)
|
|
|
|
{
|
|
|
|
char cs[6][9];
|
|
|
|
getThemeColors(cs);
|
|
|
|
oappend("<th><ca>#");
|
|
|
|
oappend(cs[0]);
|
|
|
|
oappend("</ca><cb>#");
|
|
|
|
oappend(cs[1]);
|
|
|
|
oappend("</cb><cc>#");
|
|
|
|
oappend(cs[2]);
|
|
|
|
oappend("</cc><cd>#");
|
|
|
|
oappend(cs[3]);
|
2019-01-31 23:42:48 +01:00
|
|
|
oappend("</cd><cu>#");
|
2018-11-16 19:59:00 +01:00
|
|
|
oappend(cs[4]);
|
2019-01-31 23:42:48 +01:00
|
|
|
oappend("</cu><ct>#");
|
2018-11-16 19:59:00 +01:00
|
|
|
oappend(cs[5]);
|
|
|
|
oappend("</ct><cf>");
|
|
|
|
oappend(cssFont);
|
|
|
|
oappend("</cf></th>");
|
|
|
|
}
|
|
|
|
oappend("</vs>");
|
2019-03-16 02:09:37 +01:00
|
|
|
if (request != nullptr) request->send(200, "text/xml", obuf);
|
2016-11-19 19:39:17 +01:00
|
|
|
}
|
|
|
|
|
2018-11-09 17:00:36 +01:00
|
|
|
//append a numeric setting to string buffer
|
|
|
|
void sappend(char stype, char* key, int val)
|
2018-07-20 19:35:31 +02:00
|
|
|
{
|
|
|
|
char ds[] = "d.Sf.";
|
|
|
|
|
|
|
|
switch(stype)
|
|
|
|
{
|
|
|
|
case 'c': //checkbox
|
|
|
|
oappend(ds);
|
|
|
|
oappend(key);
|
|
|
|
oappend(".checked=");
|
|
|
|
oappendi(val);
|
|
|
|
oappend(";");
|
|
|
|
break;
|
|
|
|
case 'v': //numeric
|
|
|
|
oappend(ds);
|
|
|
|
oappend(key);
|
|
|
|
oappend(".value=");
|
|
|
|
oappendi(val);
|
|
|
|
oappend(";");
|
|
|
|
break;
|
|
|
|
case 'i': //selectedIndex
|
|
|
|
oappend(ds);
|
|
|
|
oappend(key);
|
|
|
|
oappend(".selectedIndex=");
|
|
|
|
oappendi(val);
|
|
|
|
oappend(";");
|
|
|
|
break;
|
2018-07-22 21:21:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-09 17:00:36 +01:00
|
|
|
//append a string setting to buffer
|
|
|
|
void sappends(char stype, char* key, char* val)
|
2018-07-22 21:21:18 +02:00
|
|
|
{
|
|
|
|
switch(stype)
|
|
|
|
{
|
|
|
|
case 's': //string (we can interpret val as char*)
|
2018-11-09 17:00:36 +01:00
|
|
|
oappend("d.Sf.");
|
|
|
|
oappend(key);
|
|
|
|
oappend(".value=\"");
|
|
|
|
oappend(val);
|
|
|
|
oappend("\";");
|
|
|
|
break;
|
2018-07-20 19:35:31 +02:00
|
|
|
case 'm': //message
|
2018-11-09 17:00:36 +01:00
|
|
|
oappend("d.getElementsByClassName");
|
|
|
|
oappend(key);
|
|
|
|
oappend(".innerHTML=\"");
|
|
|
|
oappend(val);
|
|
|
|
oappend("\";");
|
|
|
|
break;
|
2018-07-20 19:35:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-11 17:57:06 +01:00
|
|
|
|
2018-11-09 17:00:36 +01:00
|
|
|
//get values for settings form in javascript
|
2019-03-16 02:09:37 +01:00
|
|
|
void getSettingsJS(byte subPage, char* dest)
|
2016-11-19 19:39:17 +01:00
|
|
|
{
|
2018-01-27 23:28:20 +01:00
|
|
|
//0: menu 1: wifi 2: leds 3: ui 4: sync 5: time 6: sec
|
|
|
|
DEBUG_PRINT("settings resp");
|
|
|
|
DEBUG_PRINTLN(subPage);
|
2019-03-16 02:09:37 +01:00
|
|
|
obuf = dest;
|
|
|
|
olen = 0;
|
2019-03-11 19:30:49 +01:00
|
|
|
|
2019-03-16 02:09:37 +01:00
|
|
|
if (subPage <1 || subPage >6) return;
|
2018-02-20 22:29:48 +01:00
|
|
|
|
|
|
|
if (subPage == 1) {
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"CS",clientSSID);
|
2018-07-20 19:35:31 +02:00
|
|
|
|
2018-07-21 23:21:07 +02:00
|
|
|
byte l = strlen(clientPass);
|
2018-07-20 19:35:31 +02:00
|
|
|
char fpass[l+1]; //fill password field with ***
|
|
|
|
fpass[l] = 0;
|
|
|
|
memset(fpass,'*',l);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"CP",fpass);
|
2018-07-20 19:35:31 +02:00
|
|
|
|
|
|
|
char k[3]; k[2] = 0; //IP addresses
|
|
|
|
for (int i = 0; i<4; i++)
|
2018-02-20 22:29:48 +01:00
|
|
|
{
|
2018-07-20 19:35:31 +02:00
|
|
|
k[1] = 48+i; //ascii 0,1,2,3
|
|
|
|
k[0] = 'I'; sappend('v',k,staticIP[i]);
|
|
|
|
k[0] = 'G'; sappend('v',k,staticGateway[i]);
|
|
|
|
k[0] = 'S'; sappend('v',k,staticSubnet[i]);
|
2018-02-20 22:29:48 +01:00
|
|
|
}
|
2018-07-20 19:35:31 +02:00
|
|
|
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"CM",cmDNS);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"AT",apWaitTimeSecs);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"AS",apSSID);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"AH",apHide);
|
|
|
|
|
2018-07-21 23:21:07 +02:00
|
|
|
l = strlen(apPass);
|
2018-07-20 19:35:31 +02:00
|
|
|
char fapass[l+1]; //fill password field with ***
|
|
|
|
fapass[l] = 0;
|
|
|
|
memset(fapass,'*',l);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"AP",fapass);
|
2018-07-20 19:35:31 +02:00
|
|
|
|
|
|
|
sappend('v',"AC",apChannel);
|
|
|
|
|
|
|
|
if (WiFi.localIP()[0] != 0) //is connected
|
2018-02-20 22:29:48 +01:00
|
|
|
{
|
2018-07-21 23:21:07 +02:00
|
|
|
char s[16];
|
|
|
|
IPAddress localIP = WiFi.localIP();
|
|
|
|
sprintf(s, "%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('m',"(\"sip\")[0]",s);
|
2018-02-20 22:29:48 +01:00
|
|
|
} else
|
|
|
|
{
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('m',"(\"sip\")[0]","Not connected");
|
2018-02-20 22:29:48 +01:00
|
|
|
}
|
2018-07-20 19:35:31 +02:00
|
|
|
|
|
|
|
if (WiFi.softAPIP()[0] != 0) //is active
|
2018-02-20 22:29:48 +01:00
|
|
|
{
|
2018-07-21 23:21:07 +02:00
|
|
|
char s[16];
|
|
|
|
IPAddress apIP = WiFi.softAPIP();
|
|
|
|
sprintf(s, "%d.%d.%d.%d", apIP[0], apIP[1], apIP[2], apIP[3]);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('m',"(\"sip\")[1]",s);
|
2018-02-20 22:29:48 +01:00
|
|
|
} else
|
|
|
|
{
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('m',"(\"sip\")[1]","Not active");
|
2018-02-20 22:29:48 +01:00
|
|
|
}
|
2016-11-19 19:39:17 +01:00
|
|
|
}
|
2018-02-20 22:29:48 +01:00
|
|
|
|
|
|
|
if (subPage == 2) {
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"LC",ledCount);
|
2018-12-04 00:58:06 +01:00
|
|
|
sappend('v',"MA",strip.ablMilliampsMax);
|
|
|
|
if (strip.currentMilliamps)
|
|
|
|
{
|
|
|
|
sappends('m',"(\"pow\")[0]","");
|
|
|
|
olen -= 2; //delete ";
|
|
|
|
oappendi(strip.currentMilliamps);
|
|
|
|
oappend("mA\";");
|
|
|
|
}
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"CR",colS[0]);
|
|
|
|
sappend('v',"CG",colS[1]);
|
|
|
|
sappend('v',"CB",colS[2]);
|
|
|
|
sappend('v',"CA",briS);
|
|
|
|
sappend('c',"EW",useRGBW);
|
2018-11-28 12:24:32 +01:00
|
|
|
sappend('i',"CO",strip.colorOrder);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"AW",autoRGBtoRGBW);
|
2019-02-05 21:53:39 +01:00
|
|
|
sappend('v',"CW",colS[3]);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"SR",colSecS[0]);
|
|
|
|
sappend('v',"SG",colSecS[1]);
|
|
|
|
sappend('v',"SB",colSecS[2]);
|
2019-02-05 21:53:39 +01:00
|
|
|
sappend('v',"SW",colSecS[3]);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"BO",turnOnAtBoot);
|
|
|
|
sappend('v',"BP",bootPreset);
|
2019-02-25 22:23:26 +01:00
|
|
|
oappend("f=");
|
|
|
|
oappendi(effectDefault);
|
|
|
|
oappend(";p=");
|
|
|
|
oappendi(effectPaletteDefault);
|
|
|
|
oappend(";");
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"SX",effectSpeedDefault);
|
|
|
|
sappend('v',"IX",effectIntensityDefault);
|
|
|
|
sappend('c',"GB",useGammaCorrectionBri);
|
|
|
|
sappend('c',"GC",useGammaCorrectionRGB);
|
|
|
|
sappend('c',"TF",fadeTransition);
|
|
|
|
sappend('v',"TD",transitionDelay);
|
2018-09-08 16:21:44 +02:00
|
|
|
sappend('c',"PF",strip.paletteFade);
|
2018-09-15 17:29:01 +02:00
|
|
|
sappend('c',"T2",enableSecTransition);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"BF",briMultiplier);
|
|
|
|
sappend('v',"TB",nightlightTargetBri);
|
2018-11-21 23:28:20 +01:00
|
|
|
sappend('v',"TL",nightlightDelayMinsDefault);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"TW",nightlightFade);
|
2018-09-11 00:20:12 +02:00
|
|
|
sappend('i',"PB",strip.paletteBlend);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"RV",reverseMode);
|
|
|
|
sappend('c',"SL",skipFirstLed);
|
2016-12-29 00:03:58 +01:00
|
|
|
}
|
2017-11-20 00:07:37 +01:00
|
|
|
|
2018-02-20 22:29:48 +01:00
|
|
|
if (subPage == 3)
|
|
|
|
{
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('i',"UI",uiConfiguration);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"DS",serverDescription);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"MD",useHSBDefault);
|
|
|
|
sappend('i',"TH",currentTheme);
|
|
|
|
char k[3]; k[0] = 'C'; k[2] = 0; //keys
|
|
|
|
for (int i=0; i<6; i++)
|
|
|
|
{
|
|
|
|
k[1] = 48+i; //ascii 0,1,2,3,4,5
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',k,cssCol[i]);
|
2018-07-20 19:35:31 +02:00
|
|
|
}
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"CF",cssFont);
|
2017-11-20 00:07:37 +01:00
|
|
|
}
|
2018-02-20 22:29:48 +01:00
|
|
|
|
|
|
|
if (subPage == 4)
|
2016-11-19 19:39:17 +01:00
|
|
|
{
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"BT",buttonEnabled);
|
2018-11-21 23:28:20 +01:00
|
|
|
sappend('c',"IR",irEnabled);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"UP",udpPort);
|
|
|
|
sappend('c',"RB",receiveNotificationBrightness);
|
|
|
|
sappend('c',"RC",receiveNotificationColor);
|
|
|
|
sappend('c',"RX",receiveNotificationEffects);
|
|
|
|
sappend('c',"SD",notifyDirectDefault);
|
|
|
|
sappend('c',"SB",notifyButton);
|
|
|
|
sappend('c',"SH",notifyHue);
|
2019-02-19 12:57:50 +01:00
|
|
|
sappend('c',"SM",notifyMacro);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"S2",notifyTwice);
|
|
|
|
sappend('c',"RD",receiveDirect);
|
2018-08-11 22:57:13 +02:00
|
|
|
sappend('c',"EM",e131Multicast);
|
|
|
|
sappend('v',"EU",e131Universe);
|
2018-09-15 17:29:01 +02:00
|
|
|
sappend('v',"ET",realtimeTimeoutMs);
|
2018-08-11 22:57:13 +02:00
|
|
|
sappend('c',"FB",arlsForceMaxBri);
|
|
|
|
sappend('c',"RG",arlsDisableGammaCorrection);
|
|
|
|
sappend('v',"WO",arlsOffset);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"AL",alexaEnabled);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"AI",alexaInvocationName);
|
2018-09-15 17:29:01 +02:00
|
|
|
sappend('c',"SA",notifyAlexa);
|
2018-10-08 17:36:22 +02:00
|
|
|
sappends('s',"BK",(char*)((blynkEnabled)?"Hidden":""));
|
2018-10-04 16:50:12 +02:00
|
|
|
sappends('s',"MS",mqttServer);
|
|
|
|
sappends('s',"MD",mqttDeviceTopic);
|
|
|
|
sappends('s',"MG",mqttGroupTopic);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('v',"H0",hueIP[0]);
|
|
|
|
sappend('v',"H1",hueIP[1]);
|
|
|
|
sappend('v',"H2",hueIP[2]);
|
|
|
|
sappend('v',"H3",hueIP[3]);
|
|
|
|
sappend('v',"HL",huePollLightId);
|
|
|
|
sappend('v',"HI",huePollIntervalMs);
|
|
|
|
sappend('c',"HP",huePollingEnabled);
|
|
|
|
sappend('c',"HO",hueApplyOnOff);
|
|
|
|
sappend('c',"HB",hueApplyBri);
|
|
|
|
sappend('c',"HC",hueApplyColor);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('m',"(\"hms\")[0]",hueError);
|
2016-11-19 19:39:17 +01:00
|
|
|
}
|
2018-02-20 22:29:48 +01:00
|
|
|
|
|
|
|
if (subPage == 5)
|
2016-11-19 19:39:17 +01:00
|
|
|
{
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"NT",ntpEnabled);
|
|
|
|
sappend('c',"CF",!useAMPM);
|
|
|
|
sappend('i',"TZ",currentTimezone);
|
|
|
|
sappend('v',"UO",utcOffsetSecs);
|
2019-03-16 02:09:37 +01:00
|
|
|
char tm[32];
|
|
|
|
getTimeString(tm);
|
|
|
|
sappends('m',"(\"times\")[0]",tm);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('i',"OL",overlayCurrent);
|
|
|
|
sappend('v',"O1",overlayMin);
|
|
|
|
sappend('v',"O2",overlayMax);
|
|
|
|
sappend('v',"OM",analogClock12pixel);
|
|
|
|
sappend('c',"OS",analogClockSecondsTrail);
|
|
|
|
sappend('c',"O5",analogClock5MinuteMarks);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('s',"CX",cronixieDisplay);
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"CB",cronixieBacklight);
|
|
|
|
sappend('c',"CE",countdownMode);
|
|
|
|
sappend('v',"CY",countdownYear);
|
|
|
|
sappend('v',"CI",countdownMonth);
|
|
|
|
sappend('v',"CD",countdownDay);
|
|
|
|
sappend('v',"CH",countdownHour);
|
|
|
|
sappend('v',"CM",countdownMin);
|
|
|
|
sappend('v',"CS",countdownSec);
|
|
|
|
char k[4]; k[0]= 'M';
|
2018-03-06 23:47:08 +01:00
|
|
|
for (int i=1;i<17;i++)
|
|
|
|
{
|
2019-03-16 02:09:37 +01:00
|
|
|
char m[65];
|
|
|
|
loadMacro(i, m);
|
2018-07-20 19:35:31 +02:00
|
|
|
sprintf(k+1,"%i",i);
|
2019-03-16 02:09:37 +01:00
|
|
|
sappends('s',k,m);
|
2018-03-06 23:47:08 +01:00
|
|
|
}
|
2018-07-20 19:35:31 +02:00
|
|
|
|
|
|
|
sappend('v',"MB",macroBoot);
|
|
|
|
sappend('v',"A0",macroAlexaOn);
|
|
|
|
sappend('v',"A1",macroAlexaOff);
|
|
|
|
sappend('v',"MP",macroButton);
|
|
|
|
sappend('v',"ML",macroLongPress);
|
|
|
|
sappend('v',"MC",macroCountdown);
|
|
|
|
sappend('v',"MN",macroNl);
|
2019-03-13 11:13:03 +01:00
|
|
|
sappend('v',"MD",macroDoublePress);
|
2018-09-22 22:49:24 +02:00
|
|
|
|
|
|
|
k[2] = 0; //Time macros
|
|
|
|
for (int i = 0; i<8; i++)
|
|
|
|
{
|
|
|
|
k[1] = 48+i; //ascii 0,1,2,3
|
|
|
|
k[0] = 'H'; sappend('v',k,timerHours[i]);
|
|
|
|
k[0] = 'N'; sappend('v',k,timerMinutes[i]);
|
|
|
|
k[0] = 'T'; sappend('v',k,timerMacro[i]);
|
2019-01-31 00:09:44 +01:00
|
|
|
k[0] = 'W'; sappend('v',k,timerWeekday[i]);
|
2018-09-22 22:49:24 +02:00
|
|
|
}
|
2018-02-20 22:29:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (subPage == 6)
|
2016-11-19 19:39:17 +01:00
|
|
|
{
|
2018-07-20 19:35:31 +02:00
|
|
|
sappend('c',"NO",otaLock);
|
|
|
|
sappend('c',"OW",wifiLock);
|
|
|
|
sappend('c',"AO",aOtaEnabled);
|
|
|
|
sappend('c',"NA",recoveryAPDisabled);
|
2018-07-22 21:21:18 +02:00
|
|
|
sappends('m',"(\"msg\")[0]","WLED ");
|
2018-07-20 19:35:31 +02:00
|
|
|
olen -= 2; //delete ";
|
|
|
|
oappend(versionString);
|
|
|
|
oappend(" (build ");
|
|
|
|
oappendi(VERSION);
|
|
|
|
oappend(") OK\";");
|
2016-11-19 19:39:17 +01:00
|
|
|
}
|
2018-07-20 19:35:31 +02:00
|
|
|
oappend("}</script>");
|
2016-11-19 19:39:17 +01:00
|
|
|
}
|
2018-11-16 19:59:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
//get colors from current theme as c strings
|
|
|
|
void getThemeColors(char o[][9])
|
|
|
|
{
|
|
|
|
switch (currentTheme)
|
|
|
|
{
|
|
|
|
// accent color (aCol) background (bCol) panel (cCol) controls (dCol) shadows (sCol) text (tCol)
|
|
|
|
default: strcpy(o[0], "D9B310"); strcpy(o[1], "0B3C5D"); strcpy(o[2], "1D2731"); strcpy(o[3], "328CC1"); strcpy(o[4], "000"); strcpy(o[5], "328CC1"); break; //night
|
|
|
|
case 1: strcpy(o[0], "eee"); strcpy(o[1], "ddd"); strcpy(o[2], "b9b9b9"); strcpy(o[3], "049"); strcpy(o[4], "777"); strcpy(o[5], "049"); break; //modern
|
2019-02-10 23:05:06 +01:00
|
|
|
case 2: strcpy(o[0], "abb"); strcpy(o[1], "fff"); strcpy(o[2], "ddd"); strcpy(o[3], "000"); strcpy(o[4], "0004"); strcpy(o[5], "000"); break; //bright
|
2018-11-16 19:59:00 +01:00
|
|
|
case 3: strcpy(o[0], "c09f80"); strcpy(o[1], "d7cec7"); strcpy(o[2], "76323f"); strcpy(o[3], "888"); strcpy(o[4], "3334"); strcpy(o[5], "888"); break; //wine
|
|
|
|
case 4: strcpy(o[0], "3cc47c"); strcpy(o[1], "828081"); strcpy(o[2], "d9a803"); strcpy(o[3], "1e392a"); strcpy(o[4], "000a"); strcpy(o[5], "1e392a"); break; //electric
|
|
|
|
case 5: strcpy(o[0], "57bc90"); strcpy(o[1], "a5a5af"); strcpy(o[2], "015249"); strcpy(o[3], "88c9d4"); strcpy(o[4], "0004"); strcpy(o[5], "88c9d4"); break; //mint
|
2019-02-10 23:05:06 +01:00
|
|
|
case 6: strcpy(o[0], "f7c331"); strcpy(o[1], "dca"); strcpy(o[2], "6b7a8f"); strcpy(o[3], "f7882f"); strcpy(o[4], "0007"); strcpy(o[5], "f7882f"); break; //amber
|
|
|
|
case 7: strcpy(o[0], "fff"); strcpy(o[1], "333"); strcpy(o[2], "222"); strcpy(o[3], "666"); strcpy(o[4], ""); strcpy(o[5], "fff"); break; //dark
|
2018-11-16 19:59:00 +01:00
|
|
|
case 8: strcpy(o[0], "0ac"); strcpy(o[1], "124"); strcpy(o[2], "224"); strcpy(o[3], "003eff"); strcpy(o[4], "003eff"); strcpy(o[5], "003eff"); break; //air
|
|
|
|
case 9: strcpy(o[0], "f70"); strcpy(o[1], "421"); strcpy(o[2], "221"); strcpy(o[3], "a50"); strcpy(o[4], "f70"); strcpy(o[5], "f70"); break; //nixie
|
|
|
|
case 10: strcpy(o[0], "2d2"); strcpy(o[1], "010"); strcpy(o[2], "121"); strcpy(o[3], "060"); strcpy(o[4], "040"); strcpy(o[5], "3f3"); break; //terminal
|
|
|
|
case 11: strcpy(o[0], "867ADE"); strcpy(o[1], "4033A3"); strcpy(o[2], "483AAA"); strcpy(o[3], "483AAA"); strcpy(o[4], ""); strcpy(o[5], "867ADE"); break; //c64
|
|
|
|
case 12: strcpy(o[0], "fbe8a6"); strcpy(o[1], "d2fdff"); strcpy(o[2], "b4dfe5"); strcpy(o[3], "f4976c"); strcpy(o[4], ""); strcpy(o[5], "303c6c"); break; //easter
|
|
|
|
case 13: strcpy(o[0], "d4af37"); strcpy(o[1], "173305"); strcpy(o[2], "308505"); strcpy(o[3], "f21313"); strcpy(o[4], "f002"); strcpy(o[5], "d4af37"); break; //christmas
|
|
|
|
case 14: strcpy(o[0], "fc7"); strcpy(o[1], "49274a"); strcpy(o[2], "94618e"); strcpy(o[3], "f4decb"); strcpy(o[4], "0008"); strcpy(o[5], "f4decb"); break; //end
|
|
|
|
case 15: for (int i=0;i<6;i++) strcpy(o[i], cssCol[i]); //custom
|
|
|
|
}
|
|
|
|
}
|