Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ble/adapters/_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ bool _looksLikeThermometer(String lowercaseName) =>
/// OS-level service filter does not match, so it is also named there
/// ([BandEntry.scanServiceData]).
///
/// EXPERIMENTAL (ASSUMPTIONS R6). Weight becomes a `weight` observation and
/// impedance a vendor observation. With its developer flag on (default off)
/// Verified on a physical Mi Body Composition Scale 2 (XMTZC05HM). Weight
/// becomes a `weight` observation and impedance a vendor observation. With its developer flag on (default off)
/// the newest weight within 10% of the profile's becomes it
/// (`newestWeighing`); impedance
/// stays a measurement only.
Expand Down
4 changes: 3 additions & 1 deletion lib/ble/adapters/miscale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
// impedance are shown attributed; with the scale's flag on, a weighing near
// the profile's weight becomes it (`measurement_inputs.dart`).
//
// EXPERIMENTAL (ASSUMPTIONS R6): nobody on this project owns one.
// The Mi Body Composition Scale 2 (XMTZC05HM) is verified on a physical unit:
// pairing, stored history and live weight with impedance. The Mi Smart Scale 2
// is still EXPERIMENTAL (ASSUMPTIONS R6): nobody on this project owns one.

import 'dart:async';
import 'dart:typed_data';
Expand Down
5 changes: 4 additions & 1 deletion lib/compute/derivation_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,10 @@ const String kAnalyticsPin = '3a7ca34d30233ff11e6c2877083f319a907ccb31';
// main merge commit. Re-pointed at that branch's Huami gap fix (minutes()
// empty after a counter gap); NO kAlgoVersion bump: the adapter already
// decoded only gap-free transfers, so no output changes.
const String kProtocolPin = '89080bcfac7767b3a871fd3a7d9307f5f30dad26';
// REPIN: protocol main @ b4fde6a (#81 Mi scale 7-byte history count, on top
// of #82 decoder hardening). NO kAlgoVersion bump: decode runs at ingest, so a
// bump re-derives nothing differently; WHOOP output unchanged (freeze goldens).
const String kProtocolPin = 'b4fde6ab5589e53154b808f8b2bbb4d01d9c15b5';

// Fold idempotency, the minimum-nights warm-up, and legacy-payload handling
// all live in SleepProfilePolicy (pure, unit-tested) — see
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "89080bcfac7767b3a871fd3a7d9307f5f30dad26"
resolved-ref: "89080bcfac7767b3a871fd3a7d9307f5f30dad26"
ref: "b4fde6ab5589e53154b808f8b2bbb4d01d9c15b5"
resolved-ref: "b4fde6ab5589e53154b808f8b2bbb4d01d9c15b5"
url: "https://github.com/OpenStrap/protocol.git"
source: git
version: "1.0.0"
Expand Down
8 changes: 7 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,13 @@ dependencies:
# REPIN: protocol feat/multidevice-verified-decoders head (multi-device
# decoders; WHOOP decode untouched, pinned by whoop_freeze_golden_test).
# Re-point at the merge commit once it lands on protocol main.
ref: 89080bcfac7767b3a871fd3a7d9307f5f30dad26
# REPIN: protocol main @ b4fde6a (#81: Mi Body Composition Scale 2 answers
# the history request with a 7-byte count). The range from 89080bc is 41
# commits: #81, the AGPL license/docs (#80), and #82 decoder-hardening
# (R10 gated on packet type, hello/battery parsing, reassembler
# truncation semantics, removal of deprecated gen5 APIs). #81 sits on top
# of #82, so it cannot be pinned alone.
ref: b4fde6ab5589e53154b808f8b2bbb4d01d9c15b5
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
openstrap_analytics:
git:
url: https://github.com/OpenStrap/analytics.git
Expand Down
4 changes: 3 additions & 1 deletion test/adapters/miscale_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ void main() {
final (rows, link) = await _drive(
kMiScaleComposition,
reply: (u, v) => switch ((u == kMiScaleHistoryChar, v.first)) {
(true, 0x01) => [(kMiScaleHistoryChar, [0x01, 2, 0])],
// The XMTZC05HM's real count reply is 7 bytes (captured on hardware);
// weights and stamps below are made up.
(true, 0x01) => [(kMiScaleHistoryChar, [0x01, 2, 0, 1, 0, 0, 0])],
(true, 0x02) => [
(kMiScaleHistoryChar, [
..._bc(0x22, 480, 14000, DateTime.utc(2026, 10, 2, 7)),
Expand Down
Loading