Repository navigation
fix(bluetooth): mark bf500 history and convert imperial standard masses - #1553
Conversation
|
Before going further: is the weight-only loss actually observed? Every real capture I could find — Could you attach an openScale log of one stored-reading sync with an unpatched build (release |
d88e4bf to
e939e6e
Compare
Standard weight and body-composition packets with the imperial flag carry masses in 0.01 lb, but they were stored as kilograms at that resolution, so a 150 lb reading was saved as 150 kg. Convert them to kilograms. A Date Time with year, month or day 0 means "not known", and the lenient calendar rolled impossible dates such as month 13 into another date. Leave such readings without a timestamp instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The BF500 pushes readings taken while offline as normal 2A9D/2A9C indications during consent, and the standard profile already saves them with their original timestamps. Advertise HISTORY_READ so the support table stops listing history as unavailable, and add the captured stored reading to the weigh-in tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e939e6e to
02b12b3
Compare
|
You were right, thanks for pushing back on this. I captured a stored-reading sync with the unpatched 3.1.3 release (file logging on). I weighed myself while the phone was disconnected, then reconnected. During consent, the BF500 sent that reading as a weight followed by an all-zero composition, and openScale saved it with its original timestamp, before the consent response even arrived: So master already handles BF500 history. The "two weights in a row get merged" problem I described came from reading the merge code, not from anything the scale actually does. I had only tested offline sync with my patched build, so I never noticed the release already worked. The one real problem in that log is LBM = bone = 70.3 kg, which is #789 and already fixed by your 811926e. I've cut the PR down to what still adds something, as two separate commits so you can take either one:
The BF500 assembler, the shared-decoder refactor and the protocol doc are gone. All unit tests pass. If you'd rather not have the decoder fixes, or the flag, tell me and I'll drop that commit. |
|
Merged, thanks for checking with the unpatched build and cutting the PR down. |
The BF500 already syncs readings stored while offline on master: during consent it pushes them as normal
2A9D/2A9Cindications (weight, then composition), and the standard profile saves them with their original timestamps. Captured with the unpatched 3.1.3 release:So this PR no longer adds BF500-specific assembly. What's left:
HISTORY_READfor the BF500, so the generated support table stops listing its history as unavailable. The capture above is added to the weigh-in tests.The imperial and timestamp cases come from the GATT spec, not from a capture of a misbehaving scale; each has a test that fails on master.
All 891 unit tests pass, including the captured weigh-ins in
StandardWeightProfileHandlerTestandBeurerSanitasHandlerTest.Replaces #1545, whose source fork was deleted.
🤖 Generated with Claude Code