Skip to content

Create Sleep Summary Module#4001

Merged
bobrippling merged 69 commits into
espruino:masterfrom
RKBoss6:Sleep-Summary
May 14, 2026
Merged

Create Sleep Summary Module#4001
bobrippling merged 69 commits into
espruino:masterfrom
RKBoss6:Sleep-Summary

Conversation

@RKBoss6
Copy link
Copy Markdown
Contributor

@RKBoss6 RKBoss6 commented Sep 16, 2025

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

@RKBoss6 RKBoss6 marked this pull request as draft September 16, 2025 01:56
@RKBoss6
Copy link
Copy Markdown
Contributor Author

RKBoss6 commented Sep 21, 2025

The good morning message is still under testing, as it is not showing consistently...
This is still being tested and worked on

@RKBoss6 RKBoss6 marked this pull request as ready for review May 5, 2026 01:43
Copilot AI review requested due to automatic review settings May 5, 2026 01:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sleepsummary runtime 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.

Comment thread apps/sleepsummary/module.js Outdated
Comment thread apps/sleepsummary/module.js Outdated
Comment thread apps/sleepsummary/module.js Outdated
Comment thread apps/sleepsummary/boot.js Outdated
Comment thread apps/sleepsummary/boot.js
Comment thread apps/sleepsummary/app.js Outdated
Comment thread apps/sleepsummary/README.md Outdated
Comment thread apps/sleepsummary/README.md Outdated
Comment thread apps/sleepsummary/module.js
Comment thread apps/sleepsummary/module.js Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@thyttan thyttan marked this pull request as draft May 5, 2026 22:47
Comment thread apps/sleepsummary/README.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 13 changed files in this pull request and generated 4 comments.

Comment on lines +72 to +76
lastDate: data.lastDate,
totalSleep: totalSleep,
trueSleep: data.deepSleep + data.lightSleep,
awakeSince: getMsPastMidnight((global.sleeplog || {}).info ? global.sleeplog.info.awakeSince : 0),
};
Comment thread apps/sleepsummary/module.js Outdated
Comment thread apps/sleepsummary/app.js Outdated
Comment thread apps/sleepsummary/app.js Outdated
@RKBoss6
Copy link
Copy Markdown
Contributor Author

RKBoss6 commented May 9, 2026

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?

@RKBoss6 RKBoss6 marked this pull request as ready for review May 9, 2026 19:23
@bobrippling
Copy link
Copy Markdown
Collaborator

Thanks for waiting, looks good to me - thanks for the nice app!

@bobrippling bobrippling merged commit 23464b4 into espruino:master May 14, 2026
2 checks passed
@RKBoss6 RKBoss6 deleted the Sleep-Summary branch May 14, 2026 21:49
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.

4 participants