From e5b91d3ac36f9bd04b6e4191b8e0bde5bc1dcf4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Mon, 16 Sep 2024 20:28:00 +0100 Subject: [PATCH] Garmin Forerunner 245 Music: Initial support --- .../GarminForerunner245MusicCoordinator.java | 24 +++++++++++++++++++ .../gadgetbridge/model/DeviceType.java | 2 ++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 27 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner245MusicCoordinator.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner245MusicCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner245MusicCoordinator.java new file mode 100644 index 000000000..1a8b8e9e6 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/watches/forerunner/GarminForerunner245MusicCoordinator.java @@ -0,0 +1,24 @@ +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 GarminForerunner245MusicCoordinator extends GarminCoordinator { + @Override + public boolean isExperimental() { + // https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/3986 + return true; + } + + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("^Forerunner 245 Music$"); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_garmin_forerunner_245_music; + } +} 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 630b7f764..667ed17b2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -64,6 +64,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.fenix.GarminF import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.fenix.GarminFenix7SCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner165Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner245Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner245MusicCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner255Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner255MusicCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.garmin.watches.forerunner.GarminForerunner255SCoordinator; @@ -400,6 +401,7 @@ public enum DeviceType { GARMIN_FENIX_7_PRO(GarminFenix7ProCoordinator.class), GARMIN_FORERUNNER_165(GarminForerunner165Coordinator.class), GARMIN_FORERUNNER_245(GarminForerunner245Coordinator.class), + GARMIN_FORERUNNER_245_MUSIC(GarminForerunner245MusicCoordinator.class), GARMIN_FORERUNNER_255(GarminForerunner255Coordinator.class), GARMIN_FORERUNNER_255_MUSIC(GarminForerunner255MusicCoordinator.class), GARMIN_FORERUNNER_255S(GarminForerunner255SCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cb2297548..c3f6b564a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1731,6 +1731,7 @@ Garmin Instinct Crossover Garmin Forerunner 165 Garmin Forerunner 245 + Garmin Forerunner 245 Music Garmin Forerunner 255 Garmin Forerunner 255 Music Garmin Forerunner 255S