Skip to content

v2.2.34

Choose a tag to compare

@github-actions github-actions released this 04 Sep 10:54
· 64 commits to main since this release
27d621d
Add holiday mode with per-phase wake/go/bedtime offsets

School holidays and half terms need the same routine shifted later, not a
different one. A "Holiday mode" switch plus three offsets (wake, go, bedtime,
in minutes) does that: separate per phase so a lie-in can be longer than the
later bedtime that earned it, and any of them can be 0 to leave that phase
alone.

The offsets are applied in ScheduleTime() at evaluation time rather than by
rewriting the stored times, so turning holiday mode off restores the normal
schedule exactly, with nothing to undo and no chance of drift. ShiftLater()
wraps past midnight so a late bedtime stays a valid clock time; CalculateProgress
and GetProgress already handle ranges that wrap.

Offsets apply to whichever schedule is in effect that day, weekday or weekend,
so a holiday weekend runs later than an ordinary one too.

The lambdas deliberately name their local `is_holiday`, not `holiday`: a local
called `holiday` shadows the switch's own `holiday` pointer and ESPHome's id()
macro then fails to compile with "base operand of '->' is not a pointer".