Full release of v0.6.0

Added transitionDelay from notification used for smoother sync
Fixed random color too dim
This commit is contained in:
cschwinne 2018-03-15 13:03:50 +01:00
parent 89afdd2b17
commit d09a97f230
6 changed files with 18 additions and 16 deletions

View File

@ -46,7 +46,7 @@
if (this.readyState == 4) { if (this.readyState == 4) {
if (this.status == 200) { if (this.status == 200) {
if (this.responseXML != null) { if (this.responseXML != null) {
d.Cf.SA.value = this.responseXML.getElementsByTagName('act')[0].childNodes[0].nodeValue; d.Cf.SA.value = this.responseXML.getElementsByTagName('ac')[0].childNodes[0].nodeValue;
d.Cf.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue; d.Cf.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue;
d.Cf.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue; d.Cf.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue;
d.Cf.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue; d.Cf.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue;
@ -69,7 +69,7 @@
nState = 0; nState = 0;
nState = (this.responseXML.getElementsByTagName('nr')[0].innerHTML)!=0?1:0; nState = (this.responseXML.getElementsByTagName('nr')[0].innerHTML)!=0?1:0;
nState += (this.responseXML.getElementsByTagName('ns')[0].innerHTML)!=0?2:0; nState += (this.responseXML.getElementsByTagName('ns')[0].innerHTML)!=0?2:0;
d.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('desc')[0].innerHTML; d.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('ds')[0].innerHTML;
UV(); UV();
} }
} }

View File

@ -33,7 +33,7 @@
#include "WS2812FX.h" #include "WS2812FX.h"
//version in format yymmddb (b = daily build) //version in format yymmddb (b = daily build)
#define VERSION 1803146 #define VERSION 1803151
const String versionString = "0.6.0"; const String versionString = "0.6.0";
//AP and OTA default passwords (change them!) //AP and OTA default passwords (change them!)
@ -141,6 +141,7 @@ byte colSecIT[]{0, 0, 0};
byte white, whiteOld, whiteT, whiteIT; byte white, whiteOld, whiteT, whiteIT;
byte whiteSec, whiteSecIT; byte whiteSec, whiteSecIT;
byte lastRandomIndex = 0; byte lastRandomIndex = 0;
uint16_t transitionDelayTemp = transitionDelay;
unsigned long transitionStartTime; unsigned long transitionStartTime;
unsigned long nightlightStartTime; unsigned long nightlightStartTime;
float tperLast = 0; float tperLast = 0;

View File

@ -2,21 +2,15 @@
* Receives client input * Receives client input
*/ */
void _setRandomColor(bool _sec) void _setRandomColor(bool _sec,bool fromButton=false)
{ {
lastRandomIndex = strip.get_random_wheel_index(lastRandomIndex); lastRandomIndex = strip.get_random_wheel_index(lastRandomIndex);
uint32_t _color = strip.color_wheel(lastRandomIndex);
if (_sec){ if (_sec){
whiteSec = ((_color >> 24) & 0xFF); colorHStoRGB(lastRandomIndex*256,255,colSec);
colSec[0] = ((_color >> 16) & 0xFF);
colSec[1] = ((_color >> 8) & 0xFF);
colSec[2] = (_color & 0xFF);
} else { } else {
white = ((_color >> 24) & 0xFF); colorHStoRGB(lastRandomIndex*256,255,col);
col[0] = ((_color >> 16) & 0xFF);
col[1] = ((_color >> 8) & 0xFF);
col[2] = (_color & 0xFF);
} }
if (fromButton) colorUpdated(2);
} }
void handleSettingsSet(byte subPage) void handleSettingsSet(byte subPage)

View File

@ -95,6 +95,10 @@ void handleNotifications()
effectIntensity = udpIn[16]; effectIntensity = udpIn[16];
strip.setIntensity(effectIntensity); strip.setIntensity(effectIntensity);
} }
if (udpIn[11] > 3)
{
transitionDelayTemp = ((udpIn[17] << 0) & 0xFF) + ((udpIn[18] << 8) & 0xFF00);
}
nightlightActive = udpIn[6]; nightlightActive = udpIn[6];
if (!nightlightActive) if (!nightlightActive)
{ {

View File

@ -76,6 +76,9 @@ void colorUpdated(int callMode)
notify(callMode); notify(callMode);
if (fadeTransition || sweepTransition) if (fadeTransition || sweepTransition)
{ {
//set correct delay if not using notification delay
if (callMode != 3) transitionDelayTemp = transitionDelay;
if (transitionActive) if (transitionActive)
{ {
colOld[0] = colT[0]; colOld[0] = colT[0];
@ -97,9 +100,9 @@ void colorUpdated(int callMode)
void handleTransitions() void handleTransitions()
{ {
if (transitionActive && transitionDelay > 0) if (transitionActive && transitionDelayTemp > 0)
{ {
float tper = (millis() - transitionStartTime)/(float)transitionDelay; float tper = (millis() - transitionStartTime)/(float)transitionDelayTemp;
if (tper >= 1.0) if (tper >= 1.0)
{ {
transitionActive = false; transitionActive = false;

View File

@ -20,7 +20,7 @@ void handleButton()
else if (millis() - buttonPressedTime > 700) else if (millis() - buttonPressedTime > 700)
{ {
if (macroLongPress != 0) {applyMacro(macroLongPress);} if (macroLongPress != 0) {applyMacro(macroLongPress);}
else _setRandomColor(false); else _setRandomColor(false,true);
} }
else { else {
if (macroButton == 0) if (macroButton == 0)