From a762ca9d6c6909e580044dd04d47d6fefd10ed34 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 17 Sep 2024 21:12:38 +0000 Subject: [PATCH] Add support for Garmin 955 (#4125) Co-authored-by: Grzegorz Godlewski Co-committed-by: Grzegorz Godlewski --- .../GarminForerunner955Coordinator.java | 18 ++++++++++++++++++ .../GarminForerunner965Coordinator.java | 2 +- .../gadgetbridge/model/DeviceType.java | 2 ++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner955Coordinator.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner955Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner955Coordinator.java new file mode 100644 index 000000000..d80f722d5 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner955Coordinator.java @@ -0,0 +1,18 @@ +package nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner; + +import java.util.regex.Pattern; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.garmin.GarminCoordinator; + +public class GarminForerunner955Coordinator extends GarminCoordinator { + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("^Forerunner 955$"); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_garmin_forerunner_955; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner965Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner965Coordinator.java index beecee701..d25a9b18a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner965Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner965Coordinator.java @@ -13,6 +13,6 @@ public class GarminForerunner965Coordinator extends GarminCoordinator { @Override public int getDeviceNameResource() { - return R.string.devicetype_garmin_forerunner_245; + return R.string.devicetype_garmin_forerunner_965; } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java index 0fbd5462d..2d3596fc9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -71,6 +71,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.Ga import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner255SCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner255SMusicCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner265Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner955Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner965Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.instinct.GarminInstinct2SCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.instinct.GarminInstinct2SSolarCoordinator; @@ -410,6 +411,7 @@ public enum DeviceType { GARMIN_FORERUNNER_255S(GarminForerunner255SCoordinator.class), GARMIN_FORERUNNER_255S_MUSIC(GarminForerunner255SMusicCoordinator.class), GARMIN_FORERUNNER_265(GarminForerunner265Coordinator.class), + GARMIN_FORERUNNER_955(GarminForerunner955Coordinator.class), GARMIN_FORERUNNER_965(GarminForerunner965Coordinator.class), GARMIN_SWIM_2(GarminSwim2Coordinator.class), GARMIN_INSTINCT(GarminInstinctCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3b713b89a..3a173e767 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1743,6 +1743,7 @@ Garmin Forerunner 255S Garmin Forerunner 255S Music Garmin Forerunner 265 + Garmin Forerunner 955 Garmin Forerunner 965 Garmin Swim 2 Garmin VĂ­voactive 3