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 306c89540..2e255e6c4 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 @@ -67,6 +67,7 @@ public final class HuaweiConstants { public static final String HU_WATCHGT4_NAME = "huawei watch gt 4-"; public static final String HU_WATCHFIT_NAME = "huawei watch fit-"; public static final String HU_WATCHFIT2_NAME = "huawei watch fit 2-"; + public static final String HU_WATCHFIT3_NAME = "huawei watch fit 3-"; public static final String HU_WATCHULTIMATE_NAME = "huawei watch ultimate-"; public static final String HU_WATCH4PRO_NAME = "huawei watch 4 pro-"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatchfit3/HuaweiWatchFit3Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatchfit3/HuaweiWatchFit3Coordinator.java new file mode 100644 index 000000000..2f7403d7c --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatchfit3/HuaweiWatchFit3Coordinator.java @@ -0,0 +1,56 @@ +/* Copyright (C) 2024 Damien Gaignon + + 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.huaweiwatchfit3; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +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 HuaweiWatchFit3Coordinator extends HuaweiBRCoordinator { + private static final Logger LOG = LoggerFactory.getLogger(HuaweiWatchFit3Coordinator.class); + + public HuaweiWatchFit3Coordinator() { + super(); + getHuaweiCoordinator().setTransactionCrypted(true); + } + + @Override + public boolean isExperimental() { + return true; + } + + @Override + public DeviceType getDeviceType() { + return DeviceType.HUAWEIWATCHFIT3; + } + + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("(" + HuaweiConstants.HU_WATCHFIT3_NAME + ").*", Pattern.CASE_INSENSITIVE); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_huawei_watchfit3; + } +} 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 ecc9365c3..0f2126309 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -121,6 +121,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweitalkbandb6.Huaw import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatch4pro.HuaweiWatch4ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit.HuaweiWatchFitCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit2.HuaweiWatchFit2Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit3.HuaweiWatchFit3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt.HuaweiWatchGTCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2.HuaweiWatchGT2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2e.HuaweiWatchGT2eCoordinator; @@ -371,6 +372,7 @@ public enum DeviceType { HUAWEIBAND8(HuaweiBand8Coordinator.class), HUAWEIWATCHFIT(HuaweiWatchFitCoordinator.class), HUAWEIWATCHFIT2(HuaweiWatchFit2Coordinator.class), + HUAWEIWATCHFIT3(HuaweiWatchFit3Coordinator.class), HUAWEIWATCHULTIMATE(HuaweiWatchUltimateCoordinator.class), HUAWEIWATCH4PRO(HuaweiWatch4ProCoordinator.class), VESC(VescCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 768ea9123..d63d58377 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1558,6 +1558,7 @@ Huawei Watch GT 4 Huawei Watch Fit Huawei Watch Fit 2 + Huawei Watch Fit 3 Huawei Watch Ultimate Huawei Watch 4 Pro Femometer Vinca II