diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java index 1ab05ef73..31d7b0472 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java @@ -69,6 +69,7 @@ public final class HuaweiConstants { public static final String HU_WATCHGT3SE_NAME = "huawei watch gt 3 se-"; public static final String HU_WATCHGT3PRO_NAME = "huawei watch gt 3 pro-"; public static final String HU_WATCHGTRUNNER_NAME = "huawei watch gt runner-"; + public static final String HU_WATCHGTCYBER_NAME = "huawei watch gt cyber-"; public static final String HU_WATCH3_NAME = "huawei watch 3-"; public static final String HU_WATCH3PRO_NAME = "huawei watch 3 pro-"; public static final String HU_WATCHGT4_NAME = "huawei watch gt 4-"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatchgtcyber/HuaweiWatchGTCyberCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatchgtcyber/HuaweiWatchGTCyberCoordinator.java new file mode 100644 index 000000000..084c00693 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatchgtcyber/HuaweiWatchGTCyberCoordinator.java @@ -0,0 +1,41 @@ +/* Copyright (C) 2024 Vitalii Tomin + + This file is part of Gadgetbridge. + + Gadgetbridge is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gadgetbridge is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgtcyber; + +import java.util.regex.Pattern; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiBRCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiConstants; +import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; + +public class HuaweiWatchGTCyberCoordinator extends HuaweiBRCoordinator { + @Override + public DeviceType getDeviceType() { + return DeviceType.HUAWEIWATCHGTCYBER; + } + + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("(" + HuaweiConstants.HU_WATCHGTCYBER_NAME + ").*", Pattern.CASE_INSENSITIVE); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_huawei_watchgtcyber; + } +} 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 79efd61bd..46ee41b6a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -184,6 +184,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2e.Huawe import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt3.HuaweiWatchGT3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt4.HuaweiWatchGT4Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt5.HuaweiWatchGT5Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgtcyber.HuaweiWatchGTCyberCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgtrunner.HuaweiWatchGTRunnerCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchultimate.HuaweiWatchUltimateCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.id115.ID115Coordinator; @@ -499,6 +500,7 @@ public enum DeviceType { HUAWEIWATCHGT4(HuaweiWatchGT4Coordinator.class), HUAWEIWATCHGT5(HuaweiWatchGT5Coordinator.class), HUAWEIWATCHGTRUNNER(HuaweiWatchGTRunnerCoordinator.class), + HUAWEIWATCHGTCYBER(HuaweiWatchGTCyberCoordinator.class), HUAWEIBAND8(HuaweiBand8Coordinator.class), HUAWEIBAND9(HuaweiBand9Coordinator.class), HUAWEIWATCHFIT(HuaweiWatchFitCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32fa6ab6d..28e777822 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1840,6 +1840,7 @@ Huawei Watch GT 4 Huawei Watch GT 5 (Pro) Huawei Watch GT Runner + Huawei Watch GT Cyber Huawei Watch Fit Huawei Watch Fit 2 Huawei Watch Fit 3