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

Recoginze "Xiaomi Band 3" as Mi Band 3

When running newer Firmwares (since 2.2.0.12) it is possible that devics name themselves "Xiaomi Band 3".
After a factory reset? Related to target market?

Closes #1517
This commit is contained in:
Andreas Shimokawa 2019-05-18 21:03:07 +02:00
parent dd067eddd7
commit 6b72292812
2 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ public class HuamiConst {
public static final String MI_BAND2_NAME = "MI Band 2"; public static final String MI_BAND2_NAME = "MI Band 2";
public static final String MI_BAND2_NAME_HRX = "Mi Band HRX"; public static final String MI_BAND2_NAME_HRX = "Mi Band HRX";
public static final String MI_BAND3_NAME = "Mi Band 3"; public static final String MI_BAND3_NAME = "Mi Band 3";
public static final String MI_BAND3_NAME_2 = "Xiaomi Band 3";
public static final String PREF_ACTIVATE_DISPLAY_ON_LIFT = "activate_display_on_lift_wrist"; public static final String PREF_ACTIVATE_DISPLAY_ON_LIFT = "activate_display_on_lift_wrist";
public static final String PREF_DISPLAY_ON_LIFT_START = "display_on_lift_start"; public static final String PREF_DISPLAY_ON_LIFT_START = "display_on_lift_start";

View File

@ -52,7 +52,7 @@ public class MiBand3Coordinator extends HuamiCoordinator {
try { try {
BluetoothDevice device = candidate.getDevice(); BluetoothDevice device = candidate.getDevice();
String name = device.getName(); String name = device.getName();
if (name != null && name.equalsIgnoreCase(HuamiConst.MI_BAND3_NAME)) { if (name != null && (name.equalsIgnoreCase(HuamiConst.MI_BAND3_NAME) || name.equalsIgnoreCase(HuamiConst.MI_BAND3_NAME_2))) {
return DeviceType.MIBAND3; return DeviceType.MIBAND3;
} }
} catch (Exception ex) { } catch (Exception ex) {