Fixed #18: Time triggers fail if the time is earlier than the first trigger of a day
This commit is contained in:
parent
5d314e7525
commit
b10fd6951c
@ -188,6 +188,10 @@ TimeTrigger* TimeTriggerSettings::getActiveTrigger(tmElements_t &time)
|
|||||||
dayOfWeek = Sunday;
|
dayOfWeek = Sunday;
|
||||||
else
|
else
|
||||||
dayOfWeek = (DayOfWeek)((uint8_t)dayOfWeek / 2);
|
dayOfWeek = (DayOfWeek)((uint8_t)dayOfWeek / 2);
|
||||||
|
|
||||||
|
// Set the comparison time to the end of the day, so the last
|
||||||
|
// trigger for that day will match
|
||||||
|
dayTime = 24 * 60;
|
||||||
} while (dayOfWeek != startDayOfWeek);
|
} while (dayOfWeek != startDayOfWeek);
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user