Correct sun rise (#713)
This commit is contained in:
parent
89f60a0422
commit
2e77dcc660
@ -150,8 +150,8 @@ bool useRGBW = false; //SK6812 strips can contain an ext
|
||||
bool turnOnAtBoot = true; //turn on LEDs at power-up
|
||||
byte bootPreset = 0; //save preset to load after power-up
|
||||
|
||||
byte col[] {255, 160, 0, 0}; //default RGB(W) color
|
||||
byte colSec[] {0, 0, 0, 0}; //default RGB(W) secondary color
|
||||
byte col[] {255, 160, 0, 0}; //current RGB(W) primary color. col[] should be updated if you want to change the color.
|
||||
byte colSec[] {0, 0, 0, 0}; //current RGB(W) secondary color
|
||||
byte briS = 128; //default brightness
|
||||
|
||||
byte nightlightTargetBri = 0; //brightness after nightlight is over
|
||||
@ -282,7 +282,7 @@ bool wasConnected = false;
|
||||
|
||||
//color
|
||||
byte colOld[] {0, 0, 0, 0}; //color before transition
|
||||
byte colT[] {0, 0, 0, 0}; //current color
|
||||
byte colT[] {0, 0, 0, 0}; //color that is currently displayed on the LEDs
|
||||
byte colIT[] {0, 0, 0, 0}; //color that was last sent to LEDs
|
||||
byte colSecT[] {0, 0, 0, 0};
|
||||
byte colSecOld[] {0, 0, 0, 0};
|
||||
|
@ -227,15 +227,15 @@ void handleNightlight()
|
||||
nightlightDelayMs = (int)(nightlightDelayMins*60000);
|
||||
nightlightActiveOld = true;
|
||||
briNlT = bri;
|
||||
for (byte i=0; i<4; i++) colNlT[i] = colT[i]; // remember starting color
|
||||
for (byte i=0; i<4; i++) colNlT[i] = col[i]; // remember starting color
|
||||
}
|
||||
float nper = (millis() - nightlightStartTime)/((float)nightlightDelayMs);
|
||||
if (nightlightFade)
|
||||
{
|
||||
bri = briNlT + ((nightlightTargetBri - briNlT)*nper);
|
||||
if (nightlightColorFade) // color fading only is enabled with "NF=2"
|
||||
if (nightlightColorFade) // color fading only is enabled with "NF=2"
|
||||
{
|
||||
for (byte i=0; i<4; i++) colT[i] = colNlT[i]+ ((colSecT[i] - colNlT[i])*nper); // fading from actual color to secondary color
|
||||
for (byte i=0; i<4; i++) col[i] = colNlT[i]+ ((colSec[i] - colNlT[i])*nper); // fading from actual color to secondary color
|
||||
}
|
||||
colorUpdated(NOTIFIER_CALL_MODE_NO_NOTIFY);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user