Honor Magic Watch: Initial support

This commit is contained in:
José Rebelo
2026-03-16 23:28:26 +00:00
parent 7777d70eea
commit 3230965013
5 changed files with 48 additions and 0 deletions
@@ -50,6 +50,7 @@ public final class HuaweiConstants {
public static final String HO_BAND5_NAME = "honor band 5-";
public static final String HO_BAND6_NAME = "honor band 6-";
public static final String HO_BAND7_NAME = "honor band 7-";
public static final String HO_MAGICWATCH_NAME = "honor Watch-";
public static final String HO_MAGICWATCH2_NAME = "honor magicwatch 2-";
public static final String HO_WATCHGS3_NAME = "honor watch gs 3-";
public static final String HO_WATCHGSPRO_NAME = "honor watch gs pro-";
@@ -0,0 +1,43 @@
/* 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.honormagicwatch;
import androidx.annotation.NonNull;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiConstants;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiLECoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class HonorMagicWatchCoordinator extends HuaweiLECoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile(HuaweiConstants.HO_MAGICWATCH_NAME + ".*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_honor_magicwatch;
}
@Override
public DeviceKind getDeviceKind(@NonNull GBDevice device) {
return DeviceKind.WATCH;
}
}
@@ -270,6 +270,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband4.HonorBand4
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband5.HonorBand5Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband6.HonorBand6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband7.HonorBand7Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honormagicwatch.HonorMagicWatchCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honormagicwatch2.HonorMagicWatch2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorwatch4.HonorWatch4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorwatchgs3.HonorWatchGS3Coordinator;
@@ -802,6 +803,7 @@ public enum DeviceType {
HONORBAND6(HonorBand6Coordinator.class),
HONORBAND7(HonorBand7Coordinator.class),
HONORWATCH4(HonorWatch4Coordinator.class),
HONORMAGICWATCH(HonorMagicWatchCoordinator.class),
HONORMAGICWATCH2(HonorMagicWatch2Coordinator.class),
HONORWATCHGS3(HonorWatchGS3Coordinator.class),
HONORWATCHGSPRO(HonorWatchGSProCoordinator.class),
+1
View File
@@ -2110,6 +2110,7 @@
<string name="devicetype_honor_band5" translatable="false">Honor Band 5</string>
<string name="devicetype_honor_band6" translatable="false">Honor Band 6</string>
<string name="devicetype_honor_band7" translatable="false">Honor Band 7</string>
<string name="devicetype_honor_magicwatch" translatable="false">Honor Magic Watch</string>
<string name="devicetype_honor_magicwatch2" translatable="false">Honor MagicWatch 2</string>
<string name="devicetype_honor_watchgs3" translatable="false">Honor Watch GS 3</string>
<string name="devicetype_honor_watchgspro" translatable="false">Honor Watch GS Pro</string>
@@ -173,6 +173,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("Xiaomi Smart Band 7 Pro", DeviceType.MIBAND7PRO); // #2781
put("Galaxy Buds Pro (B352)", DeviceType.GALAXY_BUDS_PRO); // #2642
put("Redmi Watch 2 Lite 31A5", DeviceType.REDMIWATCH2LITE); // #2637
put("honor Watch-7EE", DeviceType.HONORMAGICWATCH); // #5816
put("HUAWEI Band 6-A47", DeviceType.HUAWEIBAND6); // #2569
put("716", DeviceType.FITPRO);
put("LH716", DeviceType.FITPRO);