You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".