feat: support custom bpm heart-rate range in create_run_workout - #202
Closed
mmccomiskey wants to merge 1 commit into
Closed
feat: support custom bpm heart-rate range in create_run_workout#202mmccomiskey wants to merge 1 commit into
mmccomiskey wants to merge 1 commit into
Conversation
Named Garmin zones (Z1-Z5) don't always match a real training target - e.g. a 136-148 bpm Zone 2 goal straddles Garmin's Z2 (118-137) and Z3 (138-157). Previously create_run_workout only accepted hr_zone, so the watch would show "in range" for the whole zone (up to 157 bpm) even when the actual target ceiling was lower, silently misleading the in-workout HR feedback. Add optional hr_min/hr_max params that build a custom bpm-range target (targetValueOne/targetValueTwo) instead of a zoneNumber, matching a range Garmin Connect already supports natively but this tool didn't expose. hr_zone remains the default and is ignored when a range is given. Verified against the live Garmin Connect API: the custom range round-trips correctly with no zoneNumber set. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 tasks
Owner
|
Closed: the changes from this PR were applied locally, tested with CI, and merged via PR #224. Thank you for the contribution @mmccomiskey! |
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.
Summary
create_run_workoutonly accepted a named Garmin HR zone (Z1-Z5), but not every real training target lines up with a whole zone — e.g. a 136-148 bpm Zone 2 goal straddles Z2 (118-137) and Z3 (138-157). The watch would show "in range" for the entire zone (up to 157 bpm) even when the intended ceiling was lower, silently misleading in-workout HR feedback.hr_min/hr_maxparams. When both are given, the workout targets an exact custom bpm range (targetValueOne/targetValueTwo) instead of azoneNumber— a target shape Garmin Connect already supports natively (sameheart.rate.zonetarget type), just not previously exposed by this tool.hr_zoneremains the default, unchanged behavior when no range is given.Test plan
create_run_workout/build_run_jsonpass unchanged (zone-based path untouched)targetValueOne/targetValueTwowith nozoneNumber; rejects a lonehr_min/hr_max; rejectshr_min >= hr_maxhr_min/hr_maxproduces the expected uploaded JSONtargetValueOne=136.0,targetValueTwo=148.0,zoneNumber=None, then deleted the test workout🤖 Generated with Claude Code