1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +01:00

huawei: Add honor watch gs pro gadget

This commit is contained in:
Vitaliy Tomin 2024-09-12 12:36:11 +08:00
parent 9fcd463bfc
commit 02286d2c2c
4 changed files with 55 additions and 0 deletions

View File

@ -51,6 +51,7 @@ public final class HuaweiConstants {
public static final String HO_BAND7_NAME = "honor band 7-";
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-";
public static final String HU_BAND3E_NAME = "huawei band 3e-";
public static final String HU_BAND4E_NAME = "huawei band 4e-";
public static final String HU_BAND6_NAME = "huawei band 6-";

View File

@ -0,0 +1,51 @@
/* Copyright (C) 2024 Vitaly Tomin, Gaignon Damien
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.honorwatchgspro;
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 HonorWatchGSProCoordinator extends HuaweiBRCoordinator {
public HonorWatchGSProCoordinator() {
super();
getHuaweiCoordinator().setTransactionCrypted(false);
}
@Override
public String getManufacturer() {
return "Honor";
}
@Override
public DeviceType getDeviceType() {
return DeviceType.HONORWATCHGSPRO;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile(HuaweiConstants.HO_WATCHGSPRO_NAME + ".*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_honor_watchgspro;
}
}

View File

@ -160,6 +160,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband6.HonorBand6
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband7.HonorBand7Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honormagicwatch2.HonorMagicWatch2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorwatchgs3.HonorWatchGS3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorwatchgspro.HonorWatchGSProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband4pro.HuaweiBand4ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband6.HuaweiBand6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband7.HuaweiBand7Coordinator;
@ -474,6 +475,7 @@ public enum DeviceType {
HONORBAND7(HonorBand7Coordinator.class),
HONORMAGICWATCH2(HonorMagicWatch2Coordinator.class),
HONORWATCHGS3(HonorWatchGS3Coordinator.class),
HONORWATCHGSPRO(HonorWatchGSProCoordinator.class),
HUAWEIWATCHGT3(HuaweiWatchGT3Coordinator.class),
HUAWEIWATCHGT4(HuaweiWatchGT4Coordinator.class),
HUAWEIWATCHGTRUNNER(HuaweiWatchGTRunnerCoordinator.class),

View File

@ -1808,6 +1808,7 @@
<string name="devicetype_honor_band7">Honor Band 7</string>
<string name="devicetype_honor_magicwatch2">Honor MagicWatch 2</string>
<string name="devicetype_honor_watchgs3">Honor Watch GS 3</string>
<string name="devicetype_honor_watchgspro">Honor Watch GS Pro</string>
<string name="devicetype_huawei_band_aw70">Huawei Band (AW70)</string>
<string name="devicetype_huawei_band6">Huawei Band 6</string>
<string name="devicetype_huawei_band7">Huawei Band 7</string>