1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-09-01 03:55:47 +02:00

[Huawei] Add Huawei Watch 3 gadget

This commit is contained in:
Vitaliy Tomin 2024-07-18 23:03:21 +08:00
parent f4322eee7f
commit ae1cb4e893
4 changed files with 46 additions and 0 deletions

View File

@ -65,6 +65,8 @@ public final class HuaweiConstants {
public static final String HU_BAND9_NAME = "huawei band 9-";
public static final String HU_WATCHGT3_NAME = "huawei watch gt 3-";
public static final String HU_WATCHGT3PRO_NAME = "huawei watch gt 3 pro-";
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_WATCHFIT_NAME = "huawei watch fit-";
public static final String HU_WATCHFIT2_NAME = "huawei watch fit 2-";

View File

@ -0,0 +1,41 @@
/* Copyright (C) 2024 Damien Gaignon, Martin.JM, Vitalii Tomin
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.huaweiwatch3;
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 HuaweiWatch3Coordinator extends HuaweiBRCoordinator {
@Override
public DeviceType getDeviceType() {
return DeviceType.HUAWEIWATCH3;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("(" + HuaweiConstants.HU_WATCH3_NAME + "|" + HuaweiConstants.HU_WATCH3PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_huawei_watch3;
}
}

View File

@ -155,6 +155,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband8.HuaweiBan
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband9.HuaweiBand9Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweibandaw70.HuaweiBandAw70Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweitalkbandb6.HuaweiTalkBandB6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatch3.HuaweiWatch3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatch4pro.HuaweiWatch4ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit.HuaweiWatchFitCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiwatchfit2.HuaweiWatchFit2Coordinator;
@ -446,6 +447,7 @@ public enum DeviceType {
HUAWEIWATCHFIT2(HuaweiWatchFit2Coordinator.class),
HUAWEIWATCHFIT3(HuaweiWatchFit3Coordinator.class),
HUAWEIWATCHULTIMATE(HuaweiWatchUltimateCoordinator.class),
HUAWEIWATCH3(HuaweiWatch3Coordinator.class),
HUAWEIWATCH4PRO(HuaweiWatch4ProCoordinator.class),
VESC(VescCoordinator.class),
BINARY_SENSOR(BinarySensorCoordinator.class),

View File

@ -1615,6 +1615,7 @@
<string name="devicetype_huawei_watchfit2">Huawei Watch Fit 2</string>
<string name="devicetype_huawei_watchfit3">Huawei Watch Fit 3</string>
<string name="devicetype_huawei_watchultimate">Huawei Watch Ultimate</string>
<string name="devicetype_huawei_watch3">Huawei Watch 3 (Pro)</string>
<string name="devicetype_huawei_watch4pro">Huawei Watch 4 Pro</string>
<string name="devicetype_femometer_vinca2">Femometer Vinca II</string>
<string name="devicetype_xiaomi_watch_lite">Xiaomi Watch Lite</string>