Skip to content

notifications: add sleep-aware Quiet Time - #2054

Open
TheCodedKid wants to merge 4 commits into
coredevices:mainfrom
TheCodedKid:issue1804
Open

TheCodedKid wants to merge 4 commits into
coredevices:mainfrom
TheCodedKid:issue1804

Conversation

@TheCodedKid

Copy link
Copy Markdown

What

Addresses request feature found here: #1804

Reopens the work from #1833, which was auto-closed by the stale bot on 2026-09-11. That PR cannot be reopened — GitHub rejects the reopen from both the UI and the API — so this is a fresh PR with the same branch and commits.

How

  • add opt-in Sleep Aware Quiet Time during light and restful sleep
  • add an Until Wake mode that starts immediately and ends after sleep followed by waking
  • preserve manual, scheduled, calendar-aware, and sleep-aware activation as independent sources
  • expose both modes in Quiet Time settings and explain when Health Tracking is required

Sleep Aware is persisted and synchronized with notification preferences. Manually ending it during sleep overrides it only for the current sleep timeframe.

Until Wake stores whether sleep has been observed, survives restarts and temporary tracking interruptions, and does not clear unrelated Quiet Time sources when waking.

Testing

  • nix develop -c ./pbl test -M '.*services/activity/test_activity[.]c' --show_output --no_images (24 tests pass)
  • nix develop -c ./pbl test -M '.*services/test_do_not_disturb[.]c' --show_output --no_images (17 tests pass)
  • QEMU Gabbro firmware build
  • visually verified Sleep Aware, Until Wake, and the Health Tracking requirement dialog
  • gitlint across all four commits

Note: the test results above were recorded on #1833. The branch has not changed since, apart from one empty commit.

AI usage

Developed with assistance from GPT-5.6 Sol and manually reviewed.


🤖 Generated with Claude Code

https://claude.ai/code/session_018scYvnB5nx3NTS2F726gdu

TheCodedKid and others added 4 commits September 18, 2026 16:09
Emit an internal activity event whenever confirmed sleep state changes so
services can react without polling or coupling to activity internals.

Refs coredevices#1804

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
Treat confirmed light and restful sleep as an opt-in Quiet Time source.
Persist and sync the setting, consume activity transitions, and keep a
manual override in effect until the current sleep episode ends.

Refs coredevices#1804

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
Expose Sleep Aware alongside the existing automatic Quiet Time modes.
When Health Tracking is disabled, explain the requirement instead of
storing a setting that cannot take effect.

Refs coredevices#1804

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
Add a persisted temporary Quiet Time source that starts immediately and
ends only after confirmed sleep followed by wake. Expose it in settings,
retain it through tracking interruptions, and preserve unrelated Quiet
Time sources when waking clears it.

Refs coredevices#1804

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
@TheCodedKid

Copy link
Copy Markdown
Author

@gmarull @jplexer mind taking a look when you have a moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant