Skip to content
Open
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
3 changes: 2 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3582,5 +3582,6 @@
"stepCalDoneHousehold": "Gespeichert. Dein Smartphone hat {count} der {band} Schritte gezählt, die das Band erkannt hat. Bewegung im Haushalt wird jetzt auf {gain} skaliert.",
"whoopFirmwareWarningTitle": "WHOOP-Nutzer: Verbinde dich nicht wieder mit der WHOOP-App",
"whoopFirmwareWarningAction": "Wenn du OpenStrap oder eine andere Open-Source-App nutzt oder später zu einer wechseln möchtest, verbinde dein Band nicht wieder mit der offiziellen WHOOP-App. Sie kann Firmware-Updates automatisch installieren. Deinstalliere oder deaktiviere die WHOOP-App, damit sie dein Band nicht aktualisiert.",
"whoopFirmwareWarningDetails": "Berichte zur WHOOP 5.0 / MG Firmware 50.43.1.0 und 50.43.2.0 beschreiben einen blockierten Datenzugriff. Bluetooth kann sich weiterhin verbinden. OpenStrap kann das von WHOOP signierte Mitgliedschafts-Token nicht ausstellen, das betroffene Bänder entsperrt. Wir arbeiten an einer Lösung, aber es gibt noch keine Abhilfe."
"whoopFirmwareWarningDetails": "Berichte zur WHOOP 5.0 / MG Firmware 50.43.1.0 und 50.43.2.0 beschreiben einen blockierten Datenzugriff. Bluetooth kann sich weiterhin verbinden. OpenStrap kann das von WHOOP signierte Mitgliedschafts-Token nicht ausstellen, das betroffene Bänder entsperrt. Wir arbeiten an einer Lösung, aber es gibt noch keine Abhilfe.",
"dayStepsWhoop4NoCounter": "Ein WHOOP 4.0 hat keinen eigenen Schrittzähler und zählt Schritte nur, solange diese App seine Live-Daten empfängt."
}
4 changes: 4 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -16575,6 +16575,10 @@
"@strengthDelete": {"description": "Strength set editor copy."},
"strengthSaveFailed": "Failed to save changes",
"@strengthSaveFailed": {"description": "Strength set editor copy."},
"dayStepsWhoop4NoCounter": "A WHOOP 4.0 has no step counter of its own, so it only counts steps while this app is receiving its live data.",
"@dayStepsWhoop4NoCounter": {
"description": "Steps screen: appended when the paired band is a WHOOP 4.0 and it counted nothing that day, because it has no on-chip step counter"
},
"napAutoLogTitle": "Log clear naps automatically",
"napAutoLogSub": "A detected nap with strong evidence is added without asking. You can still edit or remove it",
"napAutoLogSaveFailed": "That setting could not be saved. Try again."
Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3282,5 +3282,6 @@
"stepCalDoneHousehold": "Guardado. Tu teléfono contó {count} de los {band} pasos que vio la banda. El movimiento en casa ahora se escala a {gain}.",
"whoopFirmwareWarningTitle": "Usuarios de WHOOP: no vuelvas a conectarte a la app de WHOOP",
"whoopFirmwareWarningAction": "Si usas OpenStrap u otra app de código abierto, o piensas cambiarte a una más adelante, no vuelvas a conectar tu banda a la app oficial de WHOOP. Puede instalar actualizaciones de firmware automáticamente. Desinstala o desactiva la app de WHOOP para evitar que actualice tu banda.",
"whoopFirmwareWarningDetails": "Hay informes de que el firmware 50.43.1.0 y 50.43.2.0 de WHOOP 5.0 / MG bloquea el acceso a los datos. Es posible que el Bluetooth siga conectándose. OpenStrap no puede emitir el token de membresía firmado por WHOOP que se necesita para desbloquear las bandas afectadas. Estamos trabajando en una solución, pero todavía no hay ningún arreglo disponible."
"whoopFirmwareWarningDetails": "Hay informes de que el firmware 50.43.1.0 y 50.43.2.0 de WHOOP 5.0 / MG bloquea el acceso a los datos. Es posible que el Bluetooth siga conectándose. OpenStrap no puede emitir el token de membresía firmado por WHOOP que se necesita para desbloquear las bandas afectadas. Estamos trabajando en una solución, pero todavía no hay ningún arreglo disponible.",
"dayStepsWhoop4NoCounter": "Una WHOOP 4.0 no tiene contador de pasos propio, así que solo cuenta pasos mientras esta app recibe sus datos en vivo."
}
3 changes: 2 additions & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3282,5 +3282,6 @@
"pairBandNotSensor": "Cet appareil est un {label}, c’est-à-dire un bracelet, pas un simple capteur. Rien n’a été enregistré.",
"whoopFirmwareWarningTitle": "Utilisateurs WHOOP : ne vous reconnectez pas à l’application WHOOP",
"whoopFirmwareWarningAction": "Si vous utilisez OpenStrap ou une autre application open source, ou si vous comptez y passer plus tard, ne reconnectez pas votre bracelet à l’application WHOOP officielle. Elle peut installer des mises à jour du firmware automatiquement. Désinstallez ou désactivez l’application WHOOP pour l’empêcher de mettre à jour votre bracelet.",
"whoopFirmwareWarningDetails": "Des signalements concernant les firmwares 50.43.1.0 et 50.43.2.0 des WHOOP 5.0 / MG décrivent un accès aux données bloqué. Le Bluetooth peut encore se connecter. OpenStrap ne peut pas émettre le jeton d’abonnement signé par WHOOP nécessaire pour déverrouiller les bracelets concernés. Nous travaillons sur une solution, mais aucun correctif n’est encore disponible."
"whoopFirmwareWarningDetails": "Des signalements concernant les firmwares 50.43.1.0 et 50.43.2.0 des WHOOP 5.0 / MG décrivent un accès aux données bloqué. Le Bluetooth peut encore se connecter. OpenStrap ne peut pas émettre le jeton d’abonnement signé par WHOOP nécessaire pour déverrouiller les bracelets concernés. Nous travaillons sur une solution, mais aucun correctif n’est encore disponible.",
"dayStepsWhoop4NoCounter": "Un WHOOP 4.0 n’a pas de podomètre intégré : il ne compte les pas que lorsque cette application reçoit ses données en direct."
}
3 changes: 2 additions & 1 deletion lib/l10n/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3282,5 +3282,6 @@
"stepCalRoutineTooShort": "वह अभ्यास टाइमर ख़त्म होने से पहले रुक गया। पूरा होने तक चलते रहें।",
"stepCalSaveFailed": "वह कैलिब्रेशन सहेजा नहीं जा सका।",
"stepCalDoneGait": "सहेजा गया। आपने {count} कदम गिने और बैंड ने {band} कदम देखे। अब से इस तरह की चाल {pct}% से ठीक की जाएगी।",
"stepCalDoneHousehold": "सहेजा गया। बैंड द्वारा देखे गए {band} कदमों में से आपके फ़ोन ने {count} कदम गिने। घर के कामों की हलचल अब {gain} के अनुपात में समायोजित होगी।"
"stepCalDoneHousehold": "सहेजा गया। बैंड द्वारा देखे गए {band} कदमों में से आपके फ़ोन ने {count} कदम गिने। घर के कामों की हलचल अब {gain} के अनुपात में समायोजित होगी।",
"dayStepsWhoop4NoCounter": "WHOOP 4.0 में अपना कोई स्टेप काउंटर नहीं है, इसलिए यह कदम तभी गिनता है जब यह ऐप उसका लाइव डेटा प्राप्त कर रहा हो।"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -8030,5 +8030,6 @@
"type": "String"
}
}
}
},
"dayStepsWhoop4NoCounter": "У WHOOP 4.0 нет собственного шагомера, поэтому он считает шаги только пока это приложение получает его данные в реальном времени."
}
3 changes: 2 additions & 1 deletion lib/l10n/app_th.arb
Original file line number Diff line number Diff line change
Expand Up @@ -16402,5 +16402,6 @@
"type": "String"
}
}
}
},
"dayStepsWhoop4NoCounter": "WHOOP 4.0 ไม่มีตัวนับก้าวในตัว จึงนับก้าวได้เฉพาะตอนที่แอปนี้กำลังรับข้อมูลสดจากสายรัดเท่านั้น"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3282,5 +3282,6 @@
"stepCalRoutineTooShort": "这项测试在计时结束前就停止了。请坚持到它完成。",
"stepCalSaveFailed": "无法保存此次校准。",
"stepCalDoneGait": "已保存。你数了 {count} 步,腕带记录了 {band} 步。今后这类走路将按 {pct}% 进行校正。",
"stepCalDoneHousehold": "已保存。在腕带记录的 {band} 步中,你的手机记录了 {count} 步。居家活动现在将按 {gain} 进行缩放。"
"stepCalDoneHousehold": "已保存。在腕带记录的 {band} 步中,你的手机记录了 {count} 步。居家活动现在将按 {gain} 进行缩放。",
"dayStepsWhoop4NoCounter": "WHOOP 4.0 没有自带计步器,因此只有在本应用接收其实时数据时才会计步。"
}
81 changes: 74 additions & 7 deletions lib/ui2/screens/day_steps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class DayStepsData {
this.daySource,
this.note,
this.bandLabel = _defaultBand,
this.bandHasNoCounter = false,
});

/// The fallback name for the strap. Nothing is paired, or the link has not
Expand Down Expand Up @@ -106,11 +107,18 @@ class DayStepsData {
/// or [_defaultBand] when nothing has told us which band it is.
final String bandLabel;

/// The paired band has no step counter of its own (a WHOOP 4.0): it only
/// counts while the app is receiving its live movement stream, so a walk
/// with the phone left behind leaves no steps at all. Said on the screen so
/// "it isn't tracking my steps" has its answer where the steps are.
final bool bandHasNoCounter;

bool get mixed => strap > 0 && phone > 0;

static Future<DayStepsData> load(
LocalRepository repo, {
String bandLabel = _defaultBand,
bool bandHasNoCounter = false,
String? want,
}) async {
final days = await repo.availableDays();
Expand Down Expand Up @@ -140,6 +148,7 @@ class DayStepsData {
daySource: d['day_source'] as String?,
note: d['note'] as String?,
bandLabel: bandLabel,
bandHasNoCounter: bandHasNoCounter,
);
}
}
Expand Down Expand Up @@ -273,7 +282,9 @@ class _DayStepsDetailState extends State<DayStepsDetail> {
}
try {
final d = await DayStepsData.load(repo,
bandLabel: bandLabel(context), want: _day);
bandLabel: bandLabel(context),
bandHasNoCounter: pairedBandHasNoCounter(context),
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
want: _day);
if (mounted && token == _loadToken) {
setState(() => (_d = d, _loading = false));
}
Expand Down Expand Up @@ -334,9 +345,13 @@ class _DayStepsDetailState extends State<DayStepsDetail> {
'The ${thousands(d.dayTotal)} steps $when came from the '
'strap’s own counter, which didn’t keep times for this day, '
'so they can’t go on a clock.')
: whyFromNote(d.note, unit: 'days') ??
(l?.dayStepsNothingCounted(when) ??
'Nothing that can count steps recorded $when.'),
: _withNoCounterHint(
c,
d,
whyFromNote(d.note, unit: 'days') ??
(l?.dayStepsNothingCounted(when) ??
'Nothing that can count steps recorded $when.'),
),
icon: chip ? LucideIcons.watch : LucideIcons.footprints,
);
}
Expand Down Expand Up @@ -431,9 +446,31 @@ class _DayStepsDetailState extends State<DayStepsDetail> {
? (l?.dayStepsHonestyStrap ??
'Counted at your wrist, where a real walk tends to read low and '
'rhythmic hand work can read as walking.')
: (l?.dayStepsHonestyPhone ??
'Counted by your phone, so only the steps you had it on you for '
'are here.');
: _withNoCounterHint(
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
c,
d,
l?.dayStepsHonestyPhone ??
'Counted by your phone, so only the steps you had it on you '
'for are here.',
);
}

/// [text], followed by why the band added nothing when it has no counter of
/// its own. Only ever on a day the band did not count: a day it did count
/// already shows that it can.
String _withNoCounterHint(BuildContext c, DayStepsData d, String text) {
// A day whose total came off a strap's own counter was counted by a
// band that HAS one (an earlier WHOOP 5.0 / MG): the hint would be false.
// The band can be unpaired or swapped after the day was loaded, so the
// live answer wins whenever the app state is reachable.
if (!bandStillHasNoCounter(d.bandHasNoCounter, liveBandHasNoCounter(c)) ||
d.daySource == 'strap_counter') {
return text;
}
final hint = AppLocalizations.of(c)?.dayStepsWhoop4NoCounter ??
'A WHOOP 4.0 has no step counter of its own, so it only counts steps '
'while this app is receiving its live data.';
return '$text $hint';
}

// ── the stretches themselves ───────────────────────────────────────────────
Expand Down Expand Up @@ -489,3 +526,33 @@ String bandLabel(BuildContext c) {
return fallback;
}
}

/// Whether a band of [generation] has no on-chip step counter: a WHOOP 4.0
/// (`gen4`, see `derivation_engine.dart`'s v101→102 note).
bool generationHasNoCounter(String? generation) => generation == 'gen4';

/// The answer to show: the live one when the app state could be read, else
/// what was loaded with the day.
bool bandStillHasNoCounter(bool loaded, bool? live) => live ?? loaded;

/// Whether the band paired NOW has no on-chip step counter. False when
/// nothing is paired or the generation is not known, so the hint never names
/// a band we were not told about.
bool pairedBandHasNoCounter(BuildContext c) =>
_bandHasNoCounter(c, listen: false) ?? false;

/// [pairedBandHasNoCounter] for a build: listens, so the hint follows an
/// unpair or a swap. Null when there is no app state to ask (a golden).
bool? liveBandHasNoCounter(BuildContext c) =>
_bandHasNoCounter(c, listen: true);

bool? _bandHasNoCounter(BuildContext c, {required bool listen}) {
try {
final app = listen ? c.watch<AppState>() : c.read<AppState>();
if (!app.isPaired) return false;
return generationHasNoCounter(
app.paired?.generation ?? app.device.generation);
} catch (_) {
return null;
}
}
Loading
Loading