diff --git a/src/inputs/CircadianRhythm.h b/src/inputs/CircadianRhythm.h index a8b608e..0605d4c 100644 --- a/src/inputs/CircadianRhythm.h +++ b/src/inputs/CircadianRhythm.h @@ -37,14 +37,9 @@ class CircadianRhythm : public InputSource { // Find the last hour that is prior to or equal to now if (cur.hour <= hour) { start = cur; - } else { - break; - } - } - for(ScheduleEntry cur : schedule) { // Find the first hour that is after now // If no such hour exists, we should automatically wrap back to hour 0 - if (cur.hour > hour) { + } else if (cur.hour > hour) { end = cur; break; } @@ -83,9 +78,9 @@ class CircadianRhythm : public InputSource { hour = 0; minute = 0; } - Log.notice("Current time: %d:%d", hour, minute); + Log.notice(F("Current time: %d:%d"), hour, minute); auto brightness = brightnessForTime(hour, minute); - Log.notice("Adjusting brightness to %d", brightness); + Log.notice(F("Adjusting brightness to %d"), brightness); return InputEvent{InputEvent::SetBrightness, brightness}; } return InputEvent{};