feat(train): record a ride indoors, without GPS (ADR 0030, D66)
A home trainer's or an exercise bike's ride had no place: Cycling waits for GPS and pauses by speed. Cycling indoors needs no GPS, route or device: the time, then whichever strap, speed and cadence sensor or power meter there is. It goes to Health Connect as stationary biking, and another app's stationary ride comes in as one. With no GPS, steps or device the recorder has no foreground service type, which Android 14 on doesn't allow, so it asks for the physical activity permission and doesn't start without it. Whats-New: Record a ride on a home trainer or exercise bike with Cycling indoors, without GPS. Whats-New-De: Zeichne eine Fahrt auf dem Heimtrainer mit Radfahren drinnen auf, ganz ohne GPS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
34a693f365
commit
3bd49920db
1 changed files with 275 additions and 52 deletions
|
|
@ -518,4 +518,28 @@ void main() {
|
|||
contains('<name>Run</name>'),
|
||||
);
|
||||
});
|
||||
|
||||
test('a ride indoors goes out as indoor cycling, and as a ride (D66)', () {
|
||||
final ride = Recording(
|
||||
activity: Activity.indoorCycling,
|
||||
startedAt: start,
|
||||
heartRates: [
|
||||
for (var s = 0; s <= 60; s++) HeartRate(time: at(s), bpm: 140),
|
||||
],
|
||||
endedAt: at(60),
|
||||
);
|
||||
final (rode, series) = recordedWorkout(ride);
|
||||
final track = exportTrackOf(rode, series);
|
||||
final tcx = XmlDocument.parse(tcxOf(rode, track));
|
||||
expect(
|
||||
tcx.findAllElements('Activity').single.getAttribute('Sport'),
|
||||
'Biking',
|
||||
);
|
||||
final sport = [
|
||||
for (final message in readFit(fitOf(rode, track)))
|
||||
if (message.global == 18) message.fields,
|
||||
].single;
|
||||
expect(sport[5], 2);
|
||||
expect(sport[6], 6);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue