mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 07:17:16 +00:00
Update xdrv_10_rules.ino
This commit is contained in:
parent
799dea913a
commit
3dd32a1ebd
@ -1461,14 +1461,14 @@ bool findNextVariableValue(char * &pVarname, float &value)
|
|||||||
value = Settings->timer[index -1].time;
|
value = Settings->timer[index -1].time;
|
||||||
#if defined(USE_SUNRISE)
|
#if defined(USE_SUNRISE)
|
||||||
// Correct %timerN% values for sunrise/sunset timers
|
// Correct %timerN% values for sunrise/sunset timers
|
||||||
if (Settings->timer[index -1].mode == 1 || Settings->timer[index -1].mode == 2) {
|
if ((1 == Settings->timer[index -1].mode) || (2 == Settings->timer[index -1].mode)) {
|
||||||
// in this context, time variable itself is merely an offset, with <720 being negative
|
// in this context, time variable itself is merely an offset, with <720 being negative
|
||||||
value += -720 + SunMinutes(Settings->timer[index -1].mode -1);
|
value += -720 + SunMinutes(Settings->timer[index -1].mode -1);
|
||||||
}
|
if (2 == Settings->timer[index -1].mode) {
|
||||||
if (Settings->timer[index -1].mode == 2) {
|
// To aid rule comparative statements, sunset past midnight (high lattitudes) is expressed past 24h00
|
||||||
// To aid rule comparative statements, sunset past midnight (high lattitudes) is expressed past 24h00
|
// So sunset at 00h45 is at 24h45
|
||||||
// So sunset at 00h45 is at 24h45
|
if (value < 360) { value += 1440; }
|
||||||
if (value<360) { value += 1440; }
|
}
|
||||||
}
|
}
|
||||||
#endif // USE_SUNRISE
|
#endif // USE_SUNRISE
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user