Create Sleep Summary Module#4001
Conversation
This file contains metadata for the Sleep Summary app, including its ID, name, version, description, and supported platforms.
Added timeSinceAwake setting and updated Message Time configuration.
|
The good morning message is still under testing, as it is not showing consistently... |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new sleepsummary Bangle.js app/module that derives sleep-quality metrics from sleeplog, persists learned averages, shows a morning prompt, and adds an app/settings surface for viewing and tuning the feature.
Changes:
- Adds the new
sleepsummaryruntime pieces: app UI, boot integration, settings UI, and module logic. - Registers the app in metadata and adds user-facing documentation/screenshots/changelog.
- Implements score calculation, daily caching, wake detection, and a morning summary prompt.
Reviewed changes
Copilot reviewed 8 out of 12 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
apps/sleepsummary/settings.js |
Adds settings menu for sleep scoring and prompt behavior. |
apps/sleepsummary/README.md |
Documents the module APIs, behavior, and settings. |
apps/sleepsummary/module.js |
Implements settings loading, stats aggregation, scoring, caching, and exported APIs. |
apps/sleepsummary/metadata.json |
Registers the new app/module package and storage layout. |
apps/sleepsummary/ChangeLog |
Adds initial release entry. |
apps/sleepsummary/boot.js |
Hooks into sleeplog wake events and shows the morning summary prompt. |
apps/sleepsummary/appicon.js |
Adds the app icon asset. |
apps/sleepsummary/app.js |
Adds the two-page UI for score and sleep statistics display. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| lastDate: data.lastDate, | ||
| totalSleep: totalSleep, | ||
| trueSleep: data.deepSleep + data.lightSleep, | ||
| awakeSince: getMsPastMidnight((global.sleeplog || {}).info ? global.sleeplog.info.awakeSince : 0), | ||
| }; |
|
Been testing this for some time now, it's pretty solid, and I've fixed it up pretty nicely since september! @bobrippling or @thyttan do one of you guys want to give this a go? I know @thyttan's just reviewed the massive calories PR and could probably use a break from the big PRs, so @bobrippling do you want to give this a go instead? |
|
Thanks for waiting, looks good to me - thanks for the nice app! |
This creates a module that provides a sleep score out of 100 based on how good of a sleep you got at night. It also provides an app to view stats, and a good morning message when you wake up. It averages total sleep you get, and wake up times, and that is factored into the sleep score.
More documentation in README.md
This is still under testing... feel free to test as well from my app loader