mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Honor Magic Watch: Initial support
This commit is contained in:
+1
@@ -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-";
|
||||
|
||||
+43
@@ -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),
|
||||
|
||||
@@ -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>
|
||||
|
||||
+1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user