mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 23:07:17 +00:00
insure ruletimers always stops at 0
This commit is contained in:
parent
ca09594c24
commit
5bb682b7e7
@ -974,9 +974,8 @@ void RulesEvery100ms(void)
|
||||
|
||||
void RulesEverySecond(void)
|
||||
{
|
||||
char json_event[120];
|
||||
if (Settings.rule_enabled && !Rules.busy) { // Any rule enabled
|
||||
char json_event[120];
|
||||
|
||||
if (RtcTime.valid) {
|
||||
if ((TasmotaGlobal.uptime > 60) && (RtcTime.minute != Rules.last_minute)) { // Execute from one minute after restart every minute only once
|
||||
Rules.last_minute = RtcTime.minute;
|
||||
@ -984,10 +983,12 @@ void RulesEverySecond(void)
|
||||
RulesProcessEvent(json_event);
|
||||
}
|
||||
}
|
||||
for (uint32_t i = 0; i < MAX_RULE_TIMERS; i++) {
|
||||
if (Rules.timer[i] != 0L) { // Timer active?
|
||||
if (TimeReached(Rules.timer[i])) { // Timer finished?
|
||||
Rules.timer[i] = 0L; // Turn off this timer
|
||||
}
|
||||
for (uint32_t i = 0; i < MAX_RULE_TIMERS; i++) {
|
||||
if (Rules.timer[i] != 0L) { // Timer active?
|
||||
if (TimeReached(Rules.timer[i])) { // Timer finished?
|
||||
Rules.timer[i] = 0L; // Turn off this timer
|
||||
if (Settings.rule_enabled && !Rules.busy) { // Any rule enabled
|
||||
snprintf_P(json_event, sizeof(json_event), PSTR("{\"Rules\":{\"Timer\":%d}}"), i +1);
|
||||
RulesProcessEvent(json_event);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user