Add heart rate metric to dashboard - #40
Open
void-mckenzie wants to merge 2 commits into
Open
void-mckenzie wants to merge 2 commits into
void-mckenzie wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds avg heart rate as a 4th metric alongside distance / time / elevation.
Aggregated as a time-weighted average per day/type/year so a 5-min and a 2-hour session contribute proportionally instead of equally. Days without HR data just skip the line, no placeholder dashes.
Garmin needed a small fix in
sync_garmin._normalize_activity: it was droppingaverageHRwhen building the summary schema. Strava worked without changes since its sync already writes the full payload.V1 scope is avg only. Max HR and HR zones (with zones used for the heatmap) are obvious follow-ups but I kept this PR tight.
Tests: 15 new ones covering field extraction, aggregation, JS-side rendering contracts, and an end-to-end pipeline run. Mutated each hotspot to confirm the tests actually catch regressions (broke the code, ran the test, restored).
Tested end-to-end against my own Garmin Connect account (~240 activities). Haven't tried Strava live yet. The field is in the raw payload and the unit tests cover it, but feel free to point it at a Strava account.
Let me know if you have any ideas of implementing new features, I'm happy to contribute @aspain