First commit to development branch
Added AutoRGBW feature Nightlight turns off if its target brightness is set
This commit is contained in:
parent
89b9fd8a45
commit
5d8d12bc89
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head><meta charset="utf-8">
|
<head><meta charset="utf-8">
|
||||||
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico'/>
|
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico'/>
|
||||||
<title>WLED 0.6.5</title>
|
<title>WLED 0.7.0</title>
|
||||||
<script>
|
<script>
|
||||||
var d=document;
|
var d=document;
|
||||||
var w=window.getComputedStyle(d.querySelector("html"));
|
var w=window.getComputedStyle(d.querySelector("html"));
|
||||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -93,10 +93,12 @@ Default RGB color:
|
|||||||
<input name="CG" type="number" min="0" max="255" required>
|
<input name="CG" type="number" min="0" max="255" required>
|
||||||
<input name="CB" type="number" min="0" max="255" required><br>
|
<input name="CB" type="number" min="0" max="255" required><br>
|
||||||
Default white value (only RGBW): <input name="CW" type="number" min="0" max="255" required><br>
|
Default white value (only RGBW): <input name="CW" type="number" min="0" max="255" required><br>
|
||||||
|
Auto-calculate white from RGB instead: <input type="checkbox" name="AW"><br>
|
||||||
Default brightness: <input name="CA" type="number" min="0" max="255" required> (0-255)<br>
|
Default brightness: <input name="CA" type="number" min="0" max="255" required> (0-255)<br>
|
||||||
Default effect ID: <input name="FX" type="number" min="0" max="57" required><br>
|
Default effect ID: <input name="FX" type="number" min="0" max="57" required><br>
|
||||||
Default effect speed: <input name="SX" type="number" min="0" max="255" required><br>
|
Default effect speed: <input name="SX" type="number" min="0" max="255" required><br>
|
||||||
Default effect intensity: <input name="IX" type="number" min="0" max="255" required><br>
|
Default effect intensity: <input name="IX" type="number" min="0" max="255" required><br>
|
||||||
|
Default secondary RGB(W):<br>
|
||||||
<input name="SR" type="number" min="0" max="255" required>
|
<input name="SR" type="number" min="0" max="255" required>
|
||||||
<input name="SG" type="number" min="0" max="255" required>
|
<input name="SG" type="number" min="0" max="255" required>
|
||||||
<input name="SB" type="number" min="0" max="255" required>
|
<input name="SB" type="number" min="0" max="255" required>
|
||||||
@ -345,7 +347,7 @@ HTTP traffic is unencrypted. An attacker in the same network can intercept form
|
|||||||
<button type="button" onclick="U()">Manual OTA Update</button><br>
|
<button type="button" onclick="U()">Manual OTA Update</button><br>
|
||||||
Enable ArduinoOTA: <input type="checkbox" name="AO"><br>
|
Enable ArduinoOTA: <input type="checkbox" name="AO"><br>
|
||||||
<h3>About</h3>
|
<h3>About</h3>
|
||||||
<a href="https://github.com/Aircoookie/WLED">WLED</a> version 0.6.5<br><br>
|
<a href="https://github.com/Aircoookie/WLED">WLED</a> version 0.7.0<br><br>
|
||||||
<b>Contributors:</b><br>
|
<b>Contributors:</b><br>
|
||||||
StormPie <i>(Mobile HTML UI)</i><br><br>
|
StormPie <i>(Mobile HTML UI)</i><br><br>
|
||||||
(c) 2016-2018 Christian Schwinne <br>
|
(c) 2016-2018 Christian Schwinne <br>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* @title WLED project sketch
|
* @title WLED project sketch
|
||||||
* @version 0.6.5
|
* @version 0.7.0
|
||||||
* @author Christian Schwinne
|
* @author Christian Schwinne
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -33,8 +33,8 @@
|
|||||||
#include "WS2812FX.h"
|
#include "WS2812FX.h"
|
||||||
|
|
||||||
//version in format yymmddb (b = daily build)
|
//version in format yymmddb (b = daily build)
|
||||||
#define VERSION 1805222
|
#define VERSION 1805311
|
||||||
const String versionString = "0.6.5";
|
const String versionString = "0.7.0";
|
||||||
|
|
||||||
//AP and OTA default passwords (change them!)
|
//AP and OTA default passwords (change them!)
|
||||||
String apPass = "wled1234";
|
String apPass = "wled1234";
|
||||||
@ -70,7 +70,7 @@ IPAddress staticIP(0, 0, 0, 0);
|
|||||||
IPAddress staticGateway(0, 0, 0, 0);
|
IPAddress staticGateway(0, 0, 0, 0);
|
||||||
IPAddress staticSubnet(255, 255, 255, 0);
|
IPAddress staticSubnet(255, 255, 255, 0);
|
||||||
IPAddress staticDNS(8, 8, 8, 8); //only for NTP
|
IPAddress staticDNS(8, 8, 8, 8); //only for NTP
|
||||||
bool useHSB = true, useHSBDefault = true, useRGBW = false;
|
bool useHSB = true, useHSBDefault = true, useRGBW = false, autoRGBtoRGBW = false;
|
||||||
bool turnOnAtBoot = true;
|
bool turnOnAtBoot = true;
|
||||||
bool initLedsLast = false;
|
bool initLedsLast = false;
|
||||||
byte bootPreset = 0;
|
byte bootPreset = 0;
|
||||||
|
@ -213,6 +213,7 @@ void saveSettingsToEEPROM()
|
|||||||
EEPROM.write(2200,!receiveDirect);
|
EEPROM.write(2200,!receiveDirect);
|
||||||
EEPROM.write(2201,enableRealtimeUI);
|
EEPROM.write(2201,enableRealtimeUI);
|
||||||
EEPROM.write(2202,uiConfiguration);
|
EEPROM.write(2202,uiConfiguration);
|
||||||
|
EEPROM.write(2203,autoRGBtoRGBW);
|
||||||
|
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
}
|
}
|
||||||
@ -424,6 +425,7 @@ void loadSettingsFromEEPROM(bool first)
|
|||||||
receiveDirect = !EEPROM.read(2200);
|
receiveDirect = !EEPROM.read(2200);
|
||||||
enableRealtimeUI = EEPROM.read(2201);
|
enableRealtimeUI = EEPROM.read(2201);
|
||||||
uiConfiguration = EEPROM.read(2202);
|
uiConfiguration = EEPROM.read(2202);
|
||||||
|
autoRGBtoRGBW = EEPROM.read(2203);
|
||||||
|
|
||||||
bootPreset = EEPROM.read(389);
|
bootPreset = EEPROM.read(389);
|
||||||
wifiLock = EEPROM.read(393);
|
wifiLock = EEPROM.read(393);
|
||||||
|
@ -142,6 +142,7 @@ String getSettings(byte subPage)
|
|||||||
resp += ds + "CB" + v + colS[2] +";";
|
resp += ds + "CB" + v + colS[2] +";";
|
||||||
resp += ds + "CA" + v + briS +";";
|
resp += ds + "CA" + v + briS +";";
|
||||||
resp += ds + "EW" + c + useRGBW +";";
|
resp += ds + "EW" + c + useRGBW +";";
|
||||||
|
resp += ds + "AW" + c + autoRGBtoRGBW +";";
|
||||||
resp += ds + "CW" + v + whiteS +";";
|
resp += ds + "CW" + v + whiteS +";";
|
||||||
resp += ds + "SR" + v + colSecS[0] +";";
|
resp += ds + "SR" + v + colSecS[0] +";";
|
||||||
resp += ds + "SG" + v + colSecS[1] +";";
|
resp += ds + "SG" + v + colSecS[1] +";";
|
||||||
|
@ -122,6 +122,7 @@ void handleSettingsSet(byte subPage)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
useRGBW = server.hasArg("EW");
|
useRGBW = server.hasArg("EW");
|
||||||
|
autoRGBtoRGBW = server.hasArg("AW");
|
||||||
if (server.hasArg("IS")) //ignore settings and save current brightness, colors and fx as default
|
if (server.hasArg("IS")) //ignore settings and save current brightness, colors and fx as default
|
||||||
{
|
{
|
||||||
colS[0] = col[0];
|
colS[0] = col[0];
|
||||||
@ -707,6 +708,8 @@ bool handleSet(String req)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//deactivate nightlight if target brightness is reached
|
||||||
|
if (bri == nightlightTargetBri) nightlightActive = false;
|
||||||
//set time (unix timestamp)
|
//set time (unix timestamp)
|
||||||
pos = req.indexOf("ST=");
|
pos = req.indexOf("ST=");
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
|
@ -20,6 +20,11 @@ void setAllLeds() {
|
|||||||
}
|
}
|
||||||
whiteSecT = whiteSec;
|
whiteSecT = whiteSec;
|
||||||
}
|
}
|
||||||
|
if (autoRGBtoRGBW)
|
||||||
|
{
|
||||||
|
colorRGBtoRGBW(colT,&whiteT);
|
||||||
|
colorRGBtoRGBW(colSecT,&whiteSecT);
|
||||||
|
}
|
||||||
if (useGammaCorrectionRGB)
|
if (useGammaCorrectionRGB)
|
||||||
{
|
{
|
||||||
strip.setColor(gamma8[colT[0]], gamma8[colT[1]], gamma8[colT[2]], gamma8[whiteT]);
|
strip.setColor(gamma8[colT[0]], gamma8[colT[1]], gamma8[colT[2]], gamma8[whiteT]);
|
||||||
|
@ -115,8 +115,6 @@ void colorRGBtoXY(byte* rgb, float* xy) //rgb to coordinates (https://www.develo
|
|||||||
xy[1] = Y / (X + Y + Z);
|
xy[1] = Y / (X + Y + Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//For some reason min and max are not declared here
|
|
||||||
|
|
||||||
float minf (float v, float w)
|
float minf (float v, float w)
|
||||||
{
|
{
|
||||||
if (w > v) return v;
|
if (w > v) return v;
|
||||||
@ -129,11 +127,12 @@ float maxf (float v, float w)
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void colorRGBtoRGBW(byte* rgb, byte* wht) //rgb to rgbw, untested and currently unused
|
void colorRGBtoRGBW(byte* rgb, byte* wht) //rgb to rgbw (http://codewelt.com/rgbw)
|
||||||
{
|
{
|
||||||
*wht = (float)minf(rgb[0],minf(rgb[1],rgb[2]))*0.95;
|
float low = minf(rgb[0],minf(rgb[1],rgb[2]));
|
||||||
rgb[0]-=wht;
|
float high = maxf(rgb[0],maxf(rgb[1],rgb[2]));
|
||||||
rgb[1]-=wht;
|
if (high < 0.1f) return;
|
||||||
rgb[2]-=wht;
|
float sat = 255.0f * ((high - low) / high);
|
||||||
}*/
|
*wht = (byte)((255.0f - sat) / 255.0f * (rgb[0] + rgb[1] + rgb[2]) / 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user