[Calories] Update formulas for less active inflation - #4303
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Calories app’s active-calorie estimation to reduce overestimation during low-activity periods by introducing a max-HR–based scaling factor and adjusting how step vs HR contributions are blended.
Changes:
- Adds a max-HR interpolation coefficient to scale down active calories at lower exertion levels.
- Adjusts step-rate thresholds/weighting used when blending step-based vs HR-based calorie estimates.
- Updates app docs/metadata/changelog to reflect the new formula behavior and version bump.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/calories/lib.js | Introduces max-HR scaling for active calories and updates step/HR blending logic. |
| apps/calories/README.md | Documents the added max-HR–based interpolation step in the algorithm description. |
| apps/calories/metadata.json | Bumps app version from 0.01 to 0.02. |
| apps/calories/ChangeLog | Notes the 0.02 formula adjustment aimed at reducing overestimation. |
Comments suppressed due to low confidence (2)
apps/calories/lib.js:160
- The added print statements in the core calorie calculation will run for every interval and can degrade performance and flood logs. These should be removed or gated behind an explicit debug flag.
let stepsKcalMin = (stepsMet * 3.5 * weight) / 200;
// blend METs
let finalActiveKcalMin = 0;
if (stepsPerMin > 180) {
// strenuous activity
finalActiveKcalMin = hrKcalMin * 0.5 + stepsKcalMin * 0.5;
} else if (stepsPerMin >= 60) {
apps/calories/lib.js:176
- Remove remaining debugging output from the library return path; this function is likely called periodically and should not print each time.
bmrCalories: Math.round(bmr * healthData.duration)
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Removed 'BETA' from the name and simplified the description.
Updated beta testing section to clarify app status.
|
I've also removed the |
Fixes #4286, uses different weighting and interpolation of maxHR to cut down significantly on caloric inflation.