Fixed #18: Time triggers fail if the time is earlier than the first trigger of a day

This commit is contained in:
Mark van Renswoude 2018-02-12 20:59:26 +01:00
parent 5d314e7525
commit b10fd6951c
1 changed files with 4 additions and 0 deletions

View File

@ -188,6 +188,10 @@ TimeTrigger* TimeTriggerSettings::getActiveTrigger(tmElements_t &time)
dayOfWeek = Sunday;
else
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);
return nullptr;