Repository navigation
feat(huawei): store workout cadence, altitude and power from Band 10 runs - #113
Open
vuongvm812 wants to merge 1 commit into
Open
vuongvm812 wants to merge 1 commit into
vuongvm812 wants to merge 1 commit into
Conversation
…runs Carry per-sample step rate / cadence, altitude and power from the 17/0A workout data pages (and the Gadgetbridge HUAWEI_WORKOUT_DATA_SAMPLE columns) into deviceMetricSample as the new CADENCE, ALTITUDE_M and POWER_W kinds. Absent, sentinel and zero values are not stored. One always-on strap-log line per workout reports the usable sample counts.
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
run-metrics-garmin(bottom) adds the charts; this PR (top) supplies Huawei Band 10 data. They render from the same new kinds once both merge. Not to be merged on its own.DeviceMetricKindentriesCADENCE("cadence"),POWER_W("power_w"),ALTITUDE_M("altitude_m")(Kotlin only, no migration). Swift is untouched: it has no Huawei ingest, and the Garmin PR adds the Swift entries.deviceMetricSamplethrough the existing insert. Absent, sentinel (0xFF / 0xFFFF / raw -1) and 0 values are not stored; samples outside the workout are dropped.STEP_RATE,CADENCE,ALTITUDE,CYCLING_POWERwhen the columns exist.Changes
data/WhoopRepository.ktSKIN_TEMP_Cingest/HuaweiWatchIngest.ktworkoutSeries()extracts the rows and counts;foldstores them with sourcehuawei-17-0a(orgadgetbridge)data/HuaweiHistoryIngest.ktstore(..., log)logsworkoutLineper workoutingest/Gadgetbridge{Importer,Mapping}.ktDataSourcesScreenATTRIBUTION.md,Tools/parity_*.jsonplatform_specificdispositions ("Huawei ingest exists only on Android")HuaweiWorkoutSeriesTest, extendedGadgetbridgeImporterTest, kind-list pinDecisions, from Gadgetbridge's
HuaweiWorkoutGbParser.buildActivityPoint: cadence is steps/min, taken from the step rate (field 2) for walking (types 2, 13) and otherwise from the inner-block cadence (bit 0), each falling back to the other. Altitude is stored in tenths of a metre (raw / 10). The step rate is read as an unsigned byte (& 0xFF), with raw -1 meaning absent. Power is raw watts.How to Test
cd android && ./gradlew testFullDebugUnitTest(createapp/build/roomSchemaOracleif Gradle complains).python3 Tools/parity_ledger.py --base origin/main,doc_comment_lint.py,i18n_audit.py --ci origin/main.Huawei: workout <ts> type=N usable samples hr=.. cadence=.. altitude=.. power=..in the strap log.Verification
HuaweiSyncedEngineTest,RecoveryDriversTestx2).parity_ratchet.pystill prints "base authority cannot be reproduced with the current derivation", which comes from main's base, not this change.Toolsunittest: 4test_check_source_referencesfailures from macOS/varvs/private/varpaths, unrelated.Known Limitations / Follow-ups
GpsPoint.altitudeM) is still not stored.& 0xFFuse; both readings map to the same value..noopbakon Apple relies on Swift tolerating unknown kinds (as forskin_temp_c).code-reviewskill and Codex (Codex found nothing and could not run tests).