Skip to content

feat(notifications): per-child quiet hours / DND (FEAT-5)#605

Merged
tempus2016 merged 1 commit into
mainfrom
feat/quiet-hours
Jun 26, 2026
Merged

feat(notifications): per-child quiet hours / DND (FEAT-5)#605
tempus2016 merged 1 commit into
mainfrom
feat/quiet-hours

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

FEAT-5 — Per-child quiet hours / DND

Suppresses a child's TaskMate notifications during a configurable do-not-disturb window (e.g. school hours, bedtime). Complements the existing notification routing.

Behaviour

  • Each child has a quiet-hours window (quiet_hours_start / quiet_hours_end, HH:MM).
  • In NotificationCoordinator.fire(), a child route is skipped when the current local time is inside the window.
  • start > end denotes an overnight window (e.g. 20:0007:00); the end bound is exclusive; either bound blank = disabled.
  • Parent routes are unaffected — a parent still gets "X completed a chore — awaiting approval" at any hour. The bus event also still fires (suppressed child simply isn't a recipient).

Changes

  • modelsChild.quiet_hours_start / quiet_hours_end (+ (de)serialise).
  • coord_notifications — pure _is_within_quiet_hours() helper + _child_in_quiet_hours() gate in fire().
  • websocket — fields surfaced in notifications/get_state; new notifications/set_child_quiet command (admin-only) with HH:MM validation.
  • panel — per-child quiet-hours time inputs in the Notifications → Recipients section.
  • i18npanel.notif_quiet_hours_label / _desc in all 8 locales.
  • teststest_quiet_hours.py: window logic (normal / overnight / disabled / equal-bounds / boundaries), dispatch suppression, parent-unaffected, model round-trip.

Verification

  • pytest tests/test_quiet_hours.py + notification/models/storage suites green; Ruff clean.
  • Live on ha-dev: WS round-trip set→get (20:00/07:00), invalid 99:99 rejected (invalid_format), clear→"". Panel JS node --check clean.

Part of the v4.3.1 audit fix+feature campaign. No version bump / release.

Suppress a child's notifications during a configurable do-not-disturb
window. Child model gains quiet_hours_start/quiet_hours_end (HH:MM);
NotificationCoordinator.fire() skips a child route when the current
local time falls inside the window (start>end = overnight; end
exclusive; either blank = disabled). Parent routes and the bus event
are unaffected.

- models: Child.quiet_hours_start/end + (de)serialise
- coord_notifications: _is_within_quiet_hours() pure helper +
  _child_in_quiet_hours() gate in fire()
- websocket: expose fields in notifications/get_state; new
  notifications/set_child_quiet command with HH:MM validation
- panel: per-child quiet-hours time inputs in the Recipients section
- i18n: panel.notif_quiet_hours_label/desc in all 8 locales
- tests: window logic (normal/overnight/disabled/bounds) + dispatch
  suppression + parent-unaffected + round-trip
@github-actions github-actions Bot added backend Python integration code cards Lovelace cards / frontend (www/*.js) translations i18n / locale strings tests Test suite labels Jun 26, 2026
@tempus2016 tempus2016 merged commit 62b4dec into main Jun 26, 2026
10 checks passed
@tempus2016 tempus2016 deleted the feat/quiet-hours branch June 26, 2026 11:02
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.

1 participant