Huawei Scale 3: add realtime body composition support - #1492
Open
Stefanos1000 wants to merge 1 commit into
Open
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.
## Summary
Adds realtime Huawei Scale 3 support through the existing Hagrid WSP handler.
The implementation includes:
Measurement behavior
Huawei Scale 3 reports different measurement stages independently.
The implementation therefore supports:
Realtime measurements are published immediately when received. The scale measurement-status response is then used to complete the hardware measurement cycle and re-arm the same BLE connection for another measurement.
Body composition
Huawei Scale 3 body-composition values are calculated from the low-frequency impedance measurement together with the user profile.
The calculation is implemented directly in Kotlin and does not depend on Huawei native libraries.
Huawei Hagrid credentials
The Hagrid protocol requires three authentication values:
CAK,C1andC2.These credentials are intentionally not included or hardcoded in this contribution.
I currently do not have enough evidence to determine whether these values are device-specific, model-specific, or shared between Huawei Scale 3 devices. For that reason, credentials obtained from my own Huawei setup are not being published.
openScale therefore allows the user to provide these values locally.
Obtaining the credentials
A short outline of the process used during development is:
CAKC1C2The credentials should not be posted in public logs or bug reports.
More detailed extraction documentation can be added separately if this implementation is accepted.
Tests
Added and updated tests for:
The focused unit tests pass successfully, and the implementation was also tested with a physical Huawei Scale 3.