1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 01:55:50 +01:00

Compute activity average speed

This commit is contained in:
José Rebelo 2024-11-10 22:50:58 +00:00 committed by Arjan Schrijver
parent cf308c93ad
commit 1ca387df7a

View File

@ -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);