From 1ca387df7a7f0cd1baf238bc0e48bcf4427886d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sun, 10 Nov 2024 22:50:58 +0000 Subject: [PATCH] Compute activity average speed --- .../gadgetbridge/model/ActivitySummaryJsonSummary.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivitySummaryJsonSummary.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivitySummaryJsonSummary.java index 82fce6e56..b21243812 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivitySummaryJsonSummary.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivitySummaryJsonSummary.java @@ -57,7 +57,7 @@ public class ActivitySummaryJsonSummary { summary.add("baseAltitude", item.getBaseAltitude(), UNIT_METERS); } - if (!summary.has("averageKMPaceSeconds") && !summary.has("averageSpeed") && summary.has("distanceMeters") && summary.has("activeSeconds")) { + if (!summary.has("averageSpeed") && summary.has("distanceMeters") && summary.has("activeSeconds")) { double distance = summary.getNumber("distanceMeters", 0).doubleValue(); double duration = summary.getNumber("activeSeconds", 1).doubleValue(); summary.add("averageSpeed", distance / duration, UNIT_METERS_PER_SECOND);