Changing ramp-off, overnight-off or morning-on settings doesn't reschedule until 00:01, and a ramp set to 0 leaves its job behind #165

Open
opened 2026-09-26 08:32:43 +00:00 by claude-bot · 0 comments
Collaborator

Bug

Saving schedule settings re-registers tonight's jobs only for the keys in _SCHEDULE_SETTING_KEYS (routers/schemes.py). That set leaves out:

  • ramp_off_minutes
  • overnight_off_enabled, overnight_off_time
  • morning_on_enabled, morning_on_mode, morning_on_time, morning_on_offset_min

So a change to any of these takes effect only at the 00:01 reschedule_daily run. Turning on the morning window at 20:00 does nothing tonight, and turning it off at 20:00 leaves tonight's already-registered morning_on_job in place.

Separately, when an off_ramp_job is already scheduled and the ramp is then set to 0, that job isn't removed, so tonight's off still ramps.

Found while wiring #149's settings into the same reschedule path (#162).

Fix

  • Include every envelope-affecting key in the set. Better: derive the set from a single list next to build_envelope, so a future setting can't be missed the same way. This is the same drift that caused #147.
  • Make rescheduling remove jobs whose transition no longer exists (morning window off, ramp set to 0), not just add or replace the ones that do.
  • Tests: each key triggers a reschedule, and disabling removes the job.
## Bug Saving schedule settings re-registers tonight's jobs only for the keys in `_SCHEDULE_SETTING_KEYS` (`routers/schemes.py`). That set leaves out: - `ramp_off_minutes` - `overnight_off_enabled`, `overnight_off_time` - `morning_on_enabled`, `morning_on_mode`, `morning_on_time`, `morning_on_offset_min` So a change to any of these takes effect only at the 00:01 `reschedule_daily` run. Turning on the morning window at 20:00 does nothing tonight, and turning it *off* at 20:00 leaves tonight's already-registered `morning_on_job` in place. Separately, when an `off_ramp_job` is already scheduled and the ramp is then set to 0, that job isn't removed, so tonight's off still ramps. Found while wiring #149's settings into the same reschedule path (#162). ## Fix - **Include every envelope-affecting key in the set.** Better: derive the set from a single list next to `build_envelope`, so a future setting can't be missed the same way. This is the same drift that caused #147. - **Make rescheduling remove** jobs whose transition no longer exists (morning window off, ramp set to 0), not just add or replace the ones that do. - **Tests:** each key triggers a reschedule, and disabling removes the job.
claude-bot added this to the v1.2.0 milestone 2026-09-26 08:32:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Iris-WLED#165
No description provided.