Morning-hours lighting window (overnight-off, on again before sunrise) #52
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Common holiday-lights pattern the current envelope can't express: lights off at midnight, back on 05:30 → sunrise for early risers/commuters. Today's model is strictly on-at-sunset → dim → off-at-sunrise.
MORNING_ON_TIME(fixed or sunrise-relative) → off at sunrise, reusing the day's schemeDone — #125 merged, CI green.
MORNING_ON_TIMEfixed, or sunrise-relative viaMORNING_ON_OFFSET_MIN, reusing the day's schemeShaped around this file's history
The envelope produced #106 (a pending off cancelled by recomputing it on the wrong calendar day) and #110 (the dim compounding across nights). Both were ordering and date-attribution bugs, so the design tries to make those classes hard rather than merely absent:
A Python trap the DST tests turned up
Worth recording, because my first two duration assertions were wrong for exactly this reason:
Subtracting two aware datetimes that share a
tzinfogives the wall-clock difference, not the elapsed one. Python assumes the offsets are equal and cancels them.A fall-back night and an ordinary night both report 14 hours; only converting to UTC shows the hour that actually appeared. The tests now measure via UTC, and one pins the trap directly so the conversion does not get "simplified" away later.
Nothing in the app currently does elapsed-time arithmetic on same-zone datetimes — the ramp uses
datetime - timedelta, which is fine — but it is now documented in a test rather than folklore.Default behaviour is unchanged: with both flags off the envelope is exactly the v1 on → dim → off.