1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-27 19:15:50 +01:00

Add support for HUAWEI Band3Pro (#4296)

Co-authored-by: gjaekel <gjaekel@noreply.codeberg.org>
Co-committed-by: gjaekel <gjaekel@noreply.codeberg.org>
This commit is contained in:
gjaekel 2024-11-09 15:20:48 +00:00 committed by José Rebelo
parent a2323ce845
commit 7c1d44fcd3
4 changed files with 47 additions and 1 deletions

View File

@ -56,7 +56,9 @@ public final class HuaweiConstants {
public static final String HU_BAND4E_NAME = "huawei band 4e-";
public static final String HU_BAND6_NAME = "huawei band 6-";
public static final String HU_WATCHGT_NAME = "huawei watch gt-";
public static final String HU_BAND3_NAME = "huawei band 3-";
public static final String HU_BAND4_NAME = "huawei band 4-";
public static final String HU_BAND3PRO_NAME = "huawei band 3 pro-";
public static final String HU_BAND4PRO_NAME = "huawei band 4 pro-";
public static final String HU_WATCHGT2_NAME = "huawei watch gt 2-";
public static final String HU_WATCHGT2E_NAME = "huawei watch gt 2e-";

View File

@ -0,0 +1,41 @@
/* Copyright (C) 2024 Damien Gaignon, Guido Jäkel, 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.huaweiband3pro;
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.model.DeviceType;
public class HuaweiBand3ProCoordinator extends HuaweiLECoordinator {
@Override
public DeviceType getDeviceType() {
return DeviceType.HUAWEIBAND3PRO;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("(" + HuaweiConstants.HU_BAND3_NAME + "|" + HuaweiConstants.HU_BAND3PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_huawei_band3pro;
}
}

View File

@ -2,7 +2,7 @@
Andreas Böhler, Andreas Shimokawa, Andrew Watkins, angelpup, Carsten Pfeiffer,
Cre3per, Damien Gaignon, DanialHanif, Daniel Dakhno, Daniele Gobbetti, Daniel
Thompson, Da Pa, Dmytro Bielik, Frank Ertl, Gabriele Monaco, GeekosaurusR3x,
Gordon Williams, Jean-François Greffier, jfgreffier, jhey, João Paulo
Guido Jäkel, Gordon Williams, Jean-François Greffier, jfgreffier, jhey, João Paulo
Barraca, Jochen S, Johannes Krude, José Rebelo, ksiwczynski, ladbsoft,
Lesur Frederic, Maciej Kuśnierz, mamucho, Manuel Ruß, Maxime Reyrolle,
maxirnilian, Michael, narektor, Noodlez, odavo32nof, opavlov, pangwalla,
@ -175,6 +175,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huawei.honorband7.HonorBand7
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.huaweiband3pro.HuaweiBand3ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband4pro.HuaweiBand4ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband6.HuaweiBand6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.huaweiband7.HuaweiBand7Coordinator;
@ -507,6 +508,7 @@ public enum DeviceType {
HUAWEIBANDAW70(HuaweiBandAw70Coordinator.class),
HUAWEIBAND6(HuaweiBand6Coordinator.class),
HUAWEIWATCHGT(HuaweiWatchGTCoordinator.class),
HUAWEIBAND3PRO(HuaweiBand3ProCoordinator.class),
HUAWEIBAND4PRO(HuaweiBand4ProCoordinator.class),
HUAWEIWATCHGT2(HuaweiWatchGT2Coordinator.class),
HUAWEIWATCHGT2E(HuaweiWatchGT2eCoordinator.class),

View File

@ -1846,6 +1846,7 @@
<string name="devicetype_huawei_band8">Huawei Band 8</string>
<string name="devicetype_huawei_band9">Huawei Band 9</string>
<string name="devicetype_huawei_watch_gt">Huawei Watch GT</string>
<string name="devicetype_huawei_band3pro">Huawei Band 3 (Pro)</string>
<string name="devicetype_huawei_band4pro">Huawei Band 4 (Pro)</string>
<string name="devicetype_huawei_watchgt2">Huawei Watch GT 2 (Pro)</string>
<string name="devicetype_huawei_watchgt2e">Huawei Watch GT 2e</string>