adaptive-lighting/custom_components/adaptive_lighting
Casey 5bf28bd729 Fix sun-event day-anchoring: curve collapsed to min in summer afternoons
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.
2026-06-07 20:26:42 +02:00
..
translations Rename range sliders to lower/upper + friendlier new-profile defaults 2026-06-05 10:49:40 +02:00
__init__.py Clean up all remaining ruff errors; lint is now fully green 2026-06-05 12:16:40 +02:00
adaptation_utils.py Individual manual control of brightness and color (#1356) 2025-12-22 22:55:16 -08:00
color_and_brightness.py Fix sun-event day-anchoring: curve collapsed to min in summer afternoons 2026-06-07 20:26:42 +02:00
config_flow.py Clean up all remaining ruff errors; lint is now fully green 2026-06-05 12:16:40 +02:00
const.py Rename range sliders to lower/upper + friendlier new-profile defaults 2026-06-05 10:49:40 +02:00
hass_utils.py Clean up all remaining ruff errors; lint is now fully green 2026-06-05 12:16:40 +02:00
helpers.py Friendly names (#1258) 2025-11-27 12:01:05 -08:00
manifest.json Bump version to 2.4.0-cdit.1 2026-06-05 12:40:02 +02:00
number.py Rename range sliders to lower/upper + friendlier new-profile defaults 2026-06-05 10:49:40 +02:00
sensor.py Apply ruff/black auto-fixes from ./scripts/lint 2026-06-05 10:49:30 +02:00
services.yaml Groups 8 + 9: strings, services.yaml, README, CHANGELOG (37/53) 2026-05-16 14:59:09 +02:00
strings.json Rename range sliders to lower/upper + friendlier new-profile defaults 2026-06-05 10:49:40 +02:00
switch.py Fix sun-event day-anchoring: curve collapsed to min in summer afternoons 2026-06-07 20:26:42 +02:00