Huawei Watch Fit 5 / 5 Pro: Initial support

This commit is contained in:
José Rebelo
2026-05-18 22:10:12 +01:00
parent 61f4396805
commit a6a1188a11
6 changed files with 118 additions and 0 deletions
@@ -95,6 +95,8 @@ public final class HuaweiConstants {
public static final String HU_WATCHFIT3_NAME = "huawei watch fit 3-"; public static final String HU_WATCHFIT3_NAME = "huawei watch fit 3-";
public static final String HU_WATCHFIT4_NAME = "huawei watch fit 4-"; public static final String HU_WATCHFIT4_NAME = "huawei watch fit 4-";
public static final String HU_WATCHFIT4PRO_NAME = "huawei watch fit 4 pro-"; public static final String HU_WATCHFIT4PRO_NAME = "huawei watch fit 4 pro-";
public static final String HU_WATCHFIT5_NAME = "huawei watch fit 5-";
public static final String HU_WATCHFIT5PRO_NAME = "huawei watch fit 5 pro-";
public static final String HU_WATCHULTIMATE_NAME = "huawei watch ultimate-"; public static final String HU_WATCHULTIMATE_NAME = "huawei watch ultimate-";
public static final String HU_WATCHULTIMATE2_NAME = "watch ultimate 2-"; public static final String HU_WATCHULTIMATE2_NAME = "watch ultimate 2-";
public static final String HU_WATCH4_NAME = "huawei watch 4-"; public static final String HU_WATCH4_NAME = "huawei watch 4-";
@@ -0,0 +1,54 @@
/* Copyright (C) 2026 José Rebelo
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 <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit5;
import androidx.annotation.NonNull;
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.impl.GBDevice;
public class HuaweiWatchFit5Coordinator extends HuaweiBRCoordinator {
@Override
public boolean isExperimental() {
return true;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile(HuaweiConstants.HU_WATCHFIT5_NAME + ".*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_huawei_watchfit5;
}
@Override
public boolean supportsUnicodeEmojis(@NonNull GBDevice device) {
// HarmonyOS watch
return true;
}
@Override
public DeviceKind getDeviceKind(@NonNull GBDevice device) {
return DeviceKind.WATCH;
}
}
@@ -0,0 +1,54 @@
/* Copyright (C) 2026 José Rebelo
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 <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit5pro;
import androidx.annotation.NonNull;
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.impl.GBDevice;
public class HuaweiWatchFit5ProCoordinator extends HuaweiBRCoordinator {
@Override
public boolean isExperimental() {
return true;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile(HuaweiConstants.HU_WATCHFIT5PRO_NAME + ".*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_huawei_watchfit5pro;
}
@Override
public boolean supportsUnicodeEmojis(@NonNull GBDevice device) {
// HarmonyOS watch
return true;
}
@Override
public DeviceKind getDeviceKind(@NonNull GBDevice device) {
return DeviceKind.WATCH;
}
}
@@ -304,6 +304,8 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit.Huawei
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit2.HuaweiWatchFit2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit2.HuaweiWatchFit2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit3.HuaweiWatchFit3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit3.HuaweiWatchFit3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit4pro.HuaweiWatchFit4ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit4pro.HuaweiWatchFit4ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit5.HuaweiWatchFit5Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit5pro.HuaweiWatchFit5ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt.HuaweiWatchGTCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt.HuaweiWatchGTCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2.HuaweiWatchGT2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2.HuaweiWatchGT2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2e.HuaweiWatchGT2eCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2e.HuaweiWatchGT2eCoordinator;
@@ -871,6 +873,8 @@ public enum DeviceType {
HUAWEIWATCHFIT2(HuaweiWatchFit2Coordinator.class), HUAWEIWATCHFIT2(HuaweiWatchFit2Coordinator.class),
HUAWEIWATCHFIT3(HuaweiWatchFit3Coordinator.class), HUAWEIWATCHFIT3(HuaweiWatchFit3Coordinator.class),
HUAWEIWATCHFIT4PRO(HuaweiWatchFit4ProCoordinator.class), HUAWEIWATCHFIT4PRO(HuaweiWatchFit4ProCoordinator.class),
HUAWEIWATCHFIT5(HuaweiWatchFit5Coordinator.class),
HUAWEIWATCHFIT5PRO(HuaweiWatchFit5ProCoordinator.class),
HUAWEIWATCHULTIMATE(HuaweiWatchUltimateCoordinator.class), HUAWEIWATCHULTIMATE(HuaweiWatchUltimateCoordinator.class),
HUAWEIWATCHULTIMATE2(HuaweiWatchUltimate2Coordinator.class), HUAWEIWATCHULTIMATE2(HuaweiWatchUltimate2Coordinator.class),
HUAWEIWATCH3(HuaweiWatch3Coordinator.class), HUAWEIWATCH3(HuaweiWatch3Coordinator.class),
+2
View File
@@ -2189,6 +2189,8 @@
<string name="devicetype_huawei_watchfit2" translatable="false">Huawei Watch Fit 2</string> <string name="devicetype_huawei_watchfit2" translatable="false">Huawei Watch Fit 2</string>
<string name="devicetype_huawei_watchfit3" translatable="false">Huawei Watch Fit 3</string> <string name="devicetype_huawei_watchfit3" translatable="false">Huawei Watch Fit 3</string>
<string name="devicetype_huawei_watchfit4pro" translatable="false">Huawei Watch Fit 4 (Pro)</string> <string name="devicetype_huawei_watchfit4pro" translatable="false">Huawei Watch Fit 4 (Pro)</string>
<string name="devicetype_huawei_watchfit5" translatable="false">Huawei Watch Fit 5</string>
<string name="devicetype_huawei_watchfit5pro" translatable="false">Huawei Watch Fit 5 Pro</string>
<string name="devicetype_huawei_watchultimate" translatable="false">Huawei Watch Ultimate</string> <string name="devicetype_huawei_watchultimate" translatable="false">Huawei Watch Ultimate</string>
<string name="devicetype_huawei_watchultimate2" translatable="false">Huawei Watch Ultimate 2</string> <string name="devicetype_huawei_watchultimate2" translatable="false">Huawei Watch Ultimate 2</string>
<string name="devicetype_huawei_watch3" translatable="false">Huawei Watch 3 (Pro)</string> <string name="devicetype_huawei_watch3" translatable="false">Huawei Watch 3 (Pro)</string>
@@ -74,6 +74,8 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("Redmi Buds 6 Pro", DeviceType.REDMIBUDS6PRO); put("Redmi Buds 6 Pro", DeviceType.REDMIBUDS6PRO);
put("Xiaomi Watch S4 AB01", DeviceType.XIAOMI_WATCH_S4); put("Xiaomi Watch S4 AB01", DeviceType.XIAOMI_WATCH_S4);
put("HUAWEI WATCH FIT 4 Pro-CC6", DeviceType.HUAWEIWATCHFIT4PRO); put("HUAWEI WATCH FIT 4 Pro-CC6", DeviceType.HUAWEIWATCHFIT4PRO);
put("HUAWEI WATCH FIT 5-810", DeviceType.HUAWEIWATCHFIT5); // #6097
put("Huawei Watch Fit 5 Pro-F64", DeviceType.HUAWEIWATCHFIT5PRO); // #6100
put("HUAWEI Band 11-CEF", DeviceType.HUAWEIBAND11); // #5839 put("HUAWEI Band 11-CEF", DeviceType.HUAWEIBAND11); // #5839
put("HUAWEI Band 11 Pro-C5A", DeviceType.HUAWEIBAND11PRO); // #5989 put("HUAWEI Band 11 Pro-C5A", DeviceType.HUAWEIBAND11PRO); // #5989
put("Edge Explore", DeviceType.GARMIN_EDGE_EXPLORE); // #4855 put("Edge Explore", DeviceType.GARMIN_EDGE_EXPLORE); // #4855