Added
icu_get_activity_window_statsanswers drift questions ("how did HR/power and ventilation/power develop over the ride?") with exact per-window numbers instead of the model averaging raw streams. Split an activity every N minutes (block_minutes), into N equal parts (parts), or into explicitwindows(up to 24). Each window has anicublock computed by Intervals.icu (avg/NP watts, HR, decoupling, breath rate, ventilation, tidal volume, DFA a1, plus HR/VE/BR per watt), so the numbers match the web UI. Passstreams,min_power/max_power,power_smoothing_sorlag_sfor an extrafilteredblock computed on the samples that pass the filter, for any stream including custom ones.analysisadds each per-watt ratio's drift against the first window and the whole-ride Pw:HR decoupling. When the activity has breath data,breath_rate_sourcesays where it came from (Tyme Wear, an HRV-app stream, or the recording device's HR-derived estimate) and whether it was measured. If one window's stats fail, the others still return. Each window is one API call, so many small windows use up the Intervals.icu rate limit quickly. Contributed by @yokuha (#177, #182).icu_get_activity_streamstakesstart_s/end_sto return only part of an activity,names_onlyto list the available streams, and the aliasesVE/ventilation,BRandVT. Unknown stream names come back inmissing_streamswith did-you-mean suggestions instead of failing the request. Contributed by @yokuha (#177, #182).icu_update_sport_settingstakescustom_fieldsto set per-sport defaults for custom activity fields (e.g. VT1/VT2), by field code or display name. Only the changed fields are sent, so other defaults are kept, andnullclears a value.icu_get_sport_settingsnow lists these fields with code, name and value. Contributed by @yokuha (#178, #182).icu_update_wellnesstakescustom_fieldsto write custom wellness fields. Codes are checked against your wellness fields, so a typo is an error rather than a silently ignored value. Contributed by @yokuha (#178, #182).
This takes the server from 72 tools to 73 — safe (the default) from 69 to 70, none from 63 to 64.
Fixed
icu_get_activity_intervalsnever returned interval timing or normalized power, because it read field names the API doesn't send. Each interval now hasstart_seconds,end_secondsandduration_seconds(elapsed), plusperformance.normalized_power, and the summary hastotal_work_time_seconds. Intervals also gainmoving_time_secondsandperformance.elevation_gain_meters. Contributed by @RodrigoAlegria (#187).intensity_factorwas reported as a percentage (e.g.66.98) instead of a ratio (0.67) in activity, calendar event and workout library responses. The key is unchanged, but the values are now 100 times smaller. Contributed by @RodrigoAlegria (#183).icu_get_pace_curvesreturned no peak efforts and a nonsense best pace, because it read the distance-based pace curve as if it were duration-based. Peak efforts are now keyed by standard distances (400 m, 1 km, mile, 5 km, 10 km, half marathon, marathon) with time, pace and activity. The best pace comes with the distance it was set over (best_pace_distance_meters), anddistance_rangereplacesduration_range. The duration-based keys (5_min,1_hour,best_pace_duration_seconds) are gone; they were always empty. Contributed by @RodrigoAlegria (#184).
Full Changelog: v5.8.0...v5.9.0