Xiaomi Smart Band 9: add experimental support

This commit is contained in:
MrYoranimo 2024-09-15 13:13:02 +02:00
parent cd1f270ccf
commit 35c557b62a
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,54 @@
/* Copyright (C) 2024 Yoran Vulker
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 <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband9;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
public class MiBand9Coordinator extends XiaomiCoordinator {
@Override
public int getDeviceNameResource() {
return R.string.devicetype_miband9;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^Xiaomi Smart Band 9 [0-9A-F]{4}$");
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_device_miband6;
}
@Override
public int getDisabledIconResource() {
return R.drawable.ic_device_miband6_disabled;
}
@Override
public ConnectionType getConnectionType() {
return ConnectionType.BT_CLASSIC;
}
@Override
public boolean isExperimental() {
return true;
}
}

View File

@ -249,6 +249,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband7pro.MiBand7Pro
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8.MiBand8Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8.MiBand8Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8active.MiBand8ActiveCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8active.MiBand8ActiveCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8pro.MiBand8ProCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband8pro.MiBand8ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miband9.MiBand9Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatch.MiWatchLiteCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatch.MiWatchLiteCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.miwatchcolorsport.MiWatchColorSportCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.redmismartband2.RedmiSmartBand2Coordinator;
@ -319,6 +320,7 @@ public enum DeviceType {
MIBAND8(MiBand8Coordinator.class), MIBAND8(MiBand8Coordinator.class),
MIBAND8ACTIVE(MiBand8ActiveCoordinator.class), MIBAND8ACTIVE(MiBand8ActiveCoordinator.class),
MIBAND8PRO(MiBand8ProCoordinator.class), MIBAND8PRO(MiBand8ProCoordinator.class),
MIBAND9(MiBand9Coordinator.class),
MIWATCHLITE(MiWatchLiteCoordinator.class), MIWATCHLITE(MiWatchLiteCoordinator.class),
MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class), MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class),
REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class), REDMIWATCH3ACTIVE(RedmiWatch3ActiveCoordinator.class),

View File

@ -1665,6 +1665,7 @@
<string name="devicetype_miband8">Xiaomi Smart Band 8</string> <string name="devicetype_miband8">Xiaomi Smart Band 8</string>
<string name="devicetype_miband8active">Xiaomi Smart Band 8 Active</string> <string name="devicetype_miband8active">Xiaomi Smart Band 8 Active</string>
<string name="devicetype_miband8pro">Xiaomi Smart Band 8 Pro</string> <string name="devicetype_miband8pro">Xiaomi Smart Band 8 Pro</string>
<string name="devicetype_miband9">Xiaomi Smart Band 9</string>
<string name="devicetype_amazfit_balance">Amazfit Balance</string> <string name="devicetype_amazfit_balance">Amazfit Balance</string>
<string name="devicetype_amazfit_active">Amazfit Active</string> <string name="devicetype_amazfit_active">Amazfit Active</string>
<string name="devicetype_amazfit_active_edge">Amazfit Active Edge</string> <string name="devicetype_amazfit_active_edge">Amazfit Active Edge</string>