Xiaomi Smart Band 10 Pro: Experimental support

This commit is contained in:
José Rebelo
2026-06-08 21:09:15 +01:00
parent a2c249b86e
commit fd03accd4c
4 changed files with 62 additions and 1 deletions
@@ -0,0 +1,57 @@
/* Copyright (C) 2026 José Rebelo
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.watches;
import androidx.annotation.NonNull;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class MiBand10ProCoordinator extends XiaomiCoordinator {
@Override
public int getDeviceNameResource() {
return R.string.devicetype_miband10pro;
}
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("^Xiaomi Smart Band 10 Pro [0-9A-F]{4}$");
}
@Override
public boolean isExperimental() {
return true;
}
@Override
public ConnectionType getConnectionType() {
return ConnectionType.BT_CLASSIC;
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_device_default;
}
@Override
public DeviceKind getDeviceKind(@NonNull GBDevice device) {
return DeviceKind.FITNESS_BAND;
}
}
@@ -197,6 +197,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.Y66Coordina
import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.Y6Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.gloryfit.watches.Y6Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.gree.GreeAcCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.gree.GreeAcCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hama.fit6900.HamaFit6900DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hama.fit6900.HamaFit6900DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.watches.MiBand10ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xplora.XploraXmoveDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.xplora.XploraXmoveDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator;
@@ -555,6 +556,7 @@ public enum DeviceType {
MIBAND9ACTIVE(MiBand9ActiveCoordinator.class), MIBAND9ACTIVE(MiBand9ActiveCoordinator.class),
MIBAND9PRO(MiBand9ProCoordinator.class), MIBAND9PRO(MiBand9ProCoordinator.class),
MIBAND10(MiBand10Coordinator.class), MIBAND10(MiBand10Coordinator.class),
MIBAND10PRO(MiBand10ProCoordinator.class),
MIWATCHLITE(MiWatchLiteCoordinator.class), MIWATCHLITE(MiWatchLiteCoordinator.class),
MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class), MIWATCHCOLORSPORT(MiWatchColorSportCoordinator.class),
REDMIBUDS3PRO(RedmiBuds3ProCoordinator.class), REDMIBUDS3PRO(RedmiBuds3ProCoordinator.class),
+1
View File
@@ -1906,6 +1906,7 @@
<string name="devicetype_miband9active" translatable="false">Xiaomi Smart Band 9 Active</string> <string name="devicetype_miband9active" translatable="false">Xiaomi Smart Band 9 Active</string>
<string name="devicetype_miband9pro" translatable="false">Xiaomi Smart Band 9 Pro</string> <string name="devicetype_miband9pro" translatable="false">Xiaomi Smart Band 9 Pro</string>
<string name="devicetype_miband10" translatable="false">Xiaomi Smart Band 10</string> <string name="devicetype_miband10" translatable="false">Xiaomi Smart Band 10</string>
<string name="devicetype_miband10pro" translatable="false">Xiaomi Smart Band 10 Pro</string>
<string name="devicetype_amazfit_balance" translatable="false">Amazfit Balance</string> <string name="devicetype_amazfit_balance" translatable="false">Amazfit Balance</string>
<string name="devicetype_amazfit_balance_2" translatable="false">Amazfit Balance 2</string> <string name="devicetype_amazfit_balance_2" translatable="false">Amazfit Balance 2</string>
<string name="devicetype_amazfit_balance_2_xt" translatable="false">Amazfit Balance 2 XT</string> <string name="devicetype_amazfit_balance_2_xt" translatable="false">Amazfit Balance 2 XT</string>
@@ -13,7 +13,7 @@ import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.test.TestBase; import nodomain.freeyourgadget.gadgetbridge.test.TestBase;
public class AbstractDeviceCoordinatorTest extends TestBase { public class BluetoothNameTest extends TestBase {
@Test @Test
public void deviceMatchingByNameTest() { public void deviceMatchingByNameTest() {
final Map<String, DeviceType> bluetoothNameToExpectedType = new HashMap<>() {{ final Map<String, DeviceType> bluetoothNameToExpectedType = new HashMap<>() {{
@@ -201,6 +201,7 @@ public class AbstractDeviceCoordinatorTest extends TestBase {
put("OV-Touch2.6_LE", DeviceType.OVTOUCH26); // #5628 put("OV-Touch2.6_LE", DeviceType.OVTOUCH26); // #5628
put("BPW4500", DeviceType.BRAUN_BPW4500); // #5886 put("BPW4500", DeviceType.BRAUN_BPW4500); // #5886
put("MATSON Monitor", DeviceType.BM2_BATTERY_MONITOR); // #6212 put("MATSON Monitor", DeviceType.BM2_BATTERY_MONITOR); // #6212
put("Xiaomi Smart Band 10 Pro AB01", DeviceType.MIBAND10PRO); // #6248
}}; }};
for (Map.Entry<String, DeviceType> e : bluetoothNameToExpectedType.entrySet()) { for (Map.Entry<String, DeviceType> e : bluetoothNameToExpectedType.entrySet()) {