mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-16 08:44:03 +02:00
sensor.sun_next_rising flips to tomorrow at sunrise; the old anchor only pulled it back when >12h away. With short June nights tomorrow's sunrise is within 12h by mid-afternoon, so from ~17:30 local until sunset the pair described tomorrow and the curve returned minimum. Replace the clock-distance heuristic with ordering-based anchoring in a new pure helper anchor_sun_events() (color_and_brightness.py): - daytime (sunrise > sunset): pull sunrise back one day, unconditionally - stale "today's sunset" still on yesterday: push sunset forward one day - post-sunset ramp tail (both flipped, still within half_width): pull both back so the down-ramp completes instead of snapping to min 8 regression tests incl. the June-afternoon repro and a winter check. |
||
|---|---|---|
| .. | ||
| adaptive_lighting | ||