Skip to content

feat(chores): custom "every N days" recurrence (#1038) - #1042

Merged
tempus2016 merged 2 commits into
mainfrom
feat/1038-custom-recurring-interval-every-n-days
Oct 7, 2026
Merged

tempus2016 merged 2 commits into
mainfrom
feat/1038-custom-recurring-interval-every-n-days

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Closes #1038

Recurring chores can now repeat every 2–365 days — towels every 3 days, plants every 5, a deep clean every 10.

How to use

Admin panel → Chores → edit a chore → Schedule mode: Recurring → Recurrence: Every N days (custom) → set Repeat every (days). Optionally set the recurrence start date to pin which days it falls on; leave it blank and the chore re-opens N days after the last completion.

How it works

  • Stored in the existing recurrence field as every_<N>_days (every_2_days is just N=2), so there is no new field, no migration, and no extra sensor attribute payload. Imports, exports and templates carry it as they are.
  • One shared helper (recurrence_interval_days / recurrence_period_days in const.py) drives the availability window, anchor alignment, calendar projection and the reports. The calendar card has a matching JS helper.
  • The chore list shows "Every 5 days"; the child card's existing label already reads every 5 days.
  • taskmate/add_chore / update_chore reject an out-of-range interval (every_1_days, every_400_days); the panel refuses it with a toast before it gets that far.
  • 5 new panel strings, translated into all 10 locales.

Testing

  • tests/test_every_n_days.py (17 tests): parser bounds, WS validator, availability window, anchor alignment, future anchor, calendar projection, projection report, and the no-anchor fallback. Full suite: 3034 passed; ruff, ESLint, translation parity and data-file checks all pass.
  • ha-dev: drove the real admin panel through browserless, serving this branch's panel and locales: the option is listed, the interval field replaces the weekday field, N=1 shows the range toast, saving stores every_5_days, the list row reads "Every 5 days", and reopening the editor shows the custom option with 5. Test chore removed afterwards. The Python side was not run live on ha-dev (other sessions were using the shared checkout); it is covered by the unit tests.

Recurring chores can now repeat every 2-365 days. The interval is stored
in the existing recurrence field as every_<N>_days (every_2_days is the
N=2 case), so availability, the anchor date, calendar projection, the
calendar card and reports all read one value with no new field or extra
sensor payload.

The admin panel adds an "Every N days (custom)" option with a
"Repeat every (days)" number field; the chore list shows "Every N days".
The WS add/update schemas reject an out-of-range interval.
New strings translated into every locale.
@github-actions github-actions Bot added backend Python integration code cards Lovelace cards / frontend (www/*.js) translations i18n / locale strings tests Test suite labels Oct 7, 2026
@tempus2016
tempus2016 merged commit 4fcce17 into main Oct 7, 2026
16 checks passed
@tempus2016
tempus2016 deleted the feat/1038-custom-recurring-interval-every-n-days branch October 7, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Python integration code cards Lovelace cards / frontend (www/*.js) tests Test suite translations i18n / locale strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Custom recurring interval: “Every N days”

1 participant