From b10fd6951c14947eaf78159f42290140306e0d15 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Mon, 12 Feb 2018 20:59:26 +0100 Subject: [PATCH] Fixed #18: Time triggers fail if the time is earlier than the first trigger of a day --- src/settings/triggers/time.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/settings/triggers/time.cpp b/src/settings/triggers/time.cpp index 3d8d186..7d90d1c 100644 --- a/src/settings/triggers/time.cpp +++ b/src/settings/triggers/time.cpp @@ -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;