diff --git a/lib/client.mjs b/lib/client.mjs index 730a4c1..92d8a72 100644 --- a/lib/client.mjs +++ b/lib/client.mjs @@ -53,4 +53,4 @@ export default class Trimlog { this.token = data.access_token; this.tokenExpiry = new Date(Date.now() + (data.expires_in * 1000 * 0.95)); } -} \ No newline at end of file +} diff --git a/lib/tcx.mjs b/lib/tcx.mjs index cd4071e..e93e7fc 100644 --- a/lib/tcx.mjs +++ b/lib/tcx.mjs @@ -28,7 +28,7 @@ export function generateTrimlogInput(filename, name = "Walk", type = "walk") { latitude: parseFloat(tp.Position?.[0]?.LatitudeDegrees[0]), altitude: parseFloat(tp.AltitudeMeters[0]), distance: parseFloat(tp.DistanceMeters[0]), - heartrate: parseFloat(tp.HeartRateBpm?.[0].Value?.[0]), + pulse: parseFloat(tp.HeartRateBpm?.[0].Value?.[0]), }; if (minAltitude == null || point.altitude < minAltitude) { @@ -52,7 +52,10 @@ export function generateTrimlogInput(filename, name = "Walk", type = "walk") { measurements: Object.keys(map).sort().map(k => map[k]).map(p => ({ seconds: Math.round((new Date(p.time) - date) / 1000), meters: p.distance, - pulse: p.heartrate, + pulse: p.pulse, + longitude: p.longitude, + latitude: p.latitude, + altitude: p.altitude, })) }}], description: name, @@ -75,45 +78,3 @@ export function today() { } function pad(n) {return n > 9 ? n.toString() : `0${n}`} - -/* - -{ - "date": "2023-12-31", - "contents": [ - { - "rawActivity": { - "kind": "Walking", - "sets": [], - "measurements": [ - { - "seconds": 1234, - "calories": 4321, - "meters": 432553 - }, - { - "seconds": 2468, - "calories": 42342, - "meters": 3424 - }, - { - "seconds": 3702, - "calories": 23423, - "meters": 2342 - }, - { - "seconds": 4936, - "calories": 23423, - "meters": 2342 - } - ], - "effortScale": 1, - "weight": 0 - } - } - ], - "description": "asdfasdfasdf", - "tags": [] -} - -*/ \ No newline at end of file