Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional notification of milestones reached to exstats and use it in run app #1545

Merged
merged 40 commits into from Mar 8, 2022

Conversation

GrandVizierOlaf
Copy link
Contributor

I started this as just a test to try and get my feet wet with app development, but then it expanded a bit and I thought it could be useful so I wanted to open a PR for discussion, but understand if it needs some rework.

Basically, the exstats module can now be optionally instructed to emit notify events when dist, step, or time reach milestones set by the user (like dist going up 1000 m or step going up 30 seconds). I set up the run app to make use of this and it will allow the user to customize a different Bangle.buzz() pattern per notify event type. I think this could also be useful for pedometers and eventually apps like wohrm which want to know when hrm has gone outside of given bounds. I thought that it could be helpful to have that consolidated in the exstats module rather than expecting each app to perform similar basic actions separately.

apps/recorder/app.js Outdated Show resolved Hide resolved
@gfwilliams
Copy link
Member

Thanks! I'm not too sure whether we should start loading loads of extra features into the exstats library (things like this could be in a separate exstats-notify library I guess), but this doesn't seem to use too many extra resources, and integrates quite nicely.

Merging now :)

@gfwilliams gfwilliams merged commit e2856ba into espruino:master Mar 8, 2022
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.

None yet

3 participants