huawei: Add new gadget Huawei Watch GT5 (Pro)

This commit is contained in:
Vitaliy Tomin 2024-09-23 14:44:05 +08:00 committed by José Rebelo
parent 71575c8083
commit ff1d0293fd
4 changed files with 46 additions and 0 deletions

View File

@ -71,6 +71,8 @@ public final class HuaweiConstants {
public static final String HU_WATCH3_NAME = "huawei watch 3-";
public static final String HU_WATCH3PRO_NAME = "huawei watch 3 pro-";
public static final String HU_WATCHGT4_NAME = "huawei watch gt 4-";
public static final String HU_WATCHGT5_NAME = "huawei watch gt 5-";
public static final String HU_WATCHGT5PRO_NAME = "huawei watch gt 5 pro-";
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-";

View File

@ -0,0 +1,41 @@
/* Copyright (C) 2024 Damien Gaignon, Martin.JM
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.huaweiwatchgt5;
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 HuaweiWatchGT5Coordinator extends HuaweiBRCoordinator {
@Override
public DeviceType getDeviceType() {
return DeviceType.HUAWEIWATCHGT5;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT5_NAME + "|" + HuaweiConstants.HU_WATCHGT5PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_huawei_watchgt5;
}
}

View File

@ -183,6 +183,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2.Huawei
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt2e.HuaweiWatchGT2eCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt3.HuaweiWatchGT3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt4.HuaweiWatchGT4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgt5.HuaweiWatchGT5Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchgtrunner.HuaweiWatchGTRunnerCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchultimate.HuaweiWatchUltimateCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.id115.ID115Coordinator;
@ -494,6 +495,7 @@ public enum DeviceType {
HONORWATCHGSPRO(HonorWatchGSProCoordinator.class),
HUAWEIWATCHGT3(HuaweiWatchGT3Coordinator.class),
HUAWEIWATCHGT4(HuaweiWatchGT4Coordinator.class),
HUAWEIWATCHGT5(HuaweiWatchGT5Coordinator.class),
HUAWEIWATCHGTRUNNER(HuaweiWatchGTRunnerCoordinator.class),
HUAWEIBAND8(HuaweiBand8Coordinator.class),
HUAWEIBAND9(HuaweiBand9Coordinator.class),

View File

@ -1833,6 +1833,7 @@
<string name="devicetype_huawei_talk_band_b6">Huawei Talk Band B6</string>
<string name="devicetype_huawei_watchgt3">Huawei Watch GT 3 (Pro)</string>
<string name="devicetype_huawei_watchgt4">Huawei Watch GT 4</string>
<string name="devicetype_huawei_watchgt5">Huawei Watch GT 5 (Pro)</string>
<string name="devicetype_huawei_watchgtrunner">Huawei Watch GT Runner</string>
<string name="devicetype_huawei_watchfit">Huawei Watch Fit</string>
<string name="devicetype_huawei_watchfit2">Huawei Watch Fit 2</string>