Basic support for Mi Band 2 #323, untested

here
cpfeiffer 2016-06-05 22:27:02 +02:00
parent 1ed0dc59b2
commit ca26e27c60
2 changed files with 9 additions and 1 deletions

View File

@ -28,6 +28,7 @@ public final class MiBandConst {
public static final String MI_1A = "1A";
public static final String MI_1S = "1S";
public static final String MI_AMAZFIT = "Amazfit";
public static final String MI_PRO = "2";
public static int getNotificationPrefIntValue(String pref, String origin, Prefs prefs, int defaultValue) {
String key = getNotificationPrefKey(pref, origin);

View File

@ -83,7 +83,7 @@ public class DeviceInfo extends AbstractInfo {
}
public boolean supportsHeartrate() {
return isMili1S() || (test1AHRMode && isMili1A());
return isMiliPro() || isMili1S() || (test1AHRMode && isMili1A());
}
@Override
@ -116,6 +116,10 @@ public class DeviceInfo extends AbstractInfo {
return hwVersion == 6;
}
public boolean isMiliPro() {
return hwVersion == 8 || (feature == 8 && appearance == 0);
}
public String getHwVersion() {
if (isMili1()) {
return MiBandConst.MI_1;
@ -129,6 +133,9 @@ public class DeviceInfo extends AbstractInfo {
if (isAmazFit()) {
return MiBandConst.MI_AMAZFIT;
}
if (isMiliPro()) {
return MiBandConst.MI_PRO;
}
return "?";
}
}