mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-26 16:41:43 +01:00
Mi Band 8: Fix crash due to preference type mismatch
This commit is contained in:
parent
eb2a2ca742
commit
8f89acbb25
@ -207,7 +207,7 @@ public class XiaomiHealthService extends AbstractXiaomiService {
|
|||||||
.withPreference(DeviceSettingsPreferenceConst.PREF_SPO2_ALL_DAY_MONITORING, spo2.getAllDayTracking())
|
.withPreference(DeviceSettingsPreferenceConst.PREF_SPO2_ALL_DAY_MONITORING, spo2.getAllDayTracking())
|
||||||
.withPreference(
|
.withPreference(
|
||||||
DeviceSettingsPreferenceConst.PREF_SPO2_LOW_ALERT_THRESHOLD,
|
DeviceSettingsPreferenceConst.PREF_SPO2_LOW_ALERT_THRESHOLD,
|
||||||
spo2.getAlarmLow().getAlarmLowEnabled() ? spo2.getAlarmLow().getAlarmLowThreshold() : 0
|
String.valueOf(spo2.getAlarmLow().getAlarmLowEnabled() ? spo2.getAlarmLow().getAlarmLowThreshold() : 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
getSupport().evaluateGBDeviceEvent(eventUpdatePreferences);
|
getSupport().evaluateGBDeviceEvent(eventUpdatePreferences);
|
||||||
@ -247,12 +247,12 @@ public class XiaomiHealthService extends AbstractXiaomiService {
|
|||||||
|
|
||||||
final GBDeviceEventUpdatePreferences eventUpdatePreferences = new GBDeviceEventUpdatePreferences();
|
final GBDeviceEventUpdatePreferences eventUpdatePreferences = new GBDeviceEventUpdatePreferences();
|
||||||
if (heartRate.getDisabled()) {
|
if (heartRate.getDisabled()) {
|
||||||
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, 0);
|
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, "0");
|
||||||
} else if (heartRate.getInterval() == 0) {
|
} else if (heartRate.getInterval() == 0) {
|
||||||
// smart
|
// smart
|
||||||
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, -1);
|
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, "-1");
|
||||||
} else {
|
} else {
|
||||||
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, heartRate.getInterval());
|
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, String.valueOf(heartRate.getInterval()));
|
||||||
}
|
}
|
||||||
|
|
||||||
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_USE_FOR_SLEEP_DETECTION, heartRate.getAdvancedMonitoring().getEnabled());
|
eventUpdatePreferences.withPreference(DeviceSettingsPreferenceConst.PREF_HEARTRATE_USE_FOR_SLEEP_DETECTION, heartRate.getAdvancedMonitoring().getEnabled());
|
||||||
@ -260,12 +260,12 @@ public class XiaomiHealthService extends AbstractXiaomiService {
|
|||||||
|
|
||||||
eventUpdatePreferences.withPreference(
|
eventUpdatePreferences.withPreference(
|
||||||
DeviceSettingsPreferenceConst.PREF_HEARTRATE_ALERT_HIGH_THRESHOLD,
|
DeviceSettingsPreferenceConst.PREF_HEARTRATE_ALERT_HIGH_THRESHOLD,
|
||||||
heartRate.getAlarmHighEnabled() ? heartRate.getAlarmHighThreshold() : 0
|
String.valueOf(heartRate.getAlarmHighEnabled() ? heartRate.getAlarmHighThreshold() : 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
eventUpdatePreferences.withPreference(
|
eventUpdatePreferences.withPreference(
|
||||||
DeviceSettingsPreferenceConst.PREF_HEARTRATE_ALERT_LOW_THRESHOLD,
|
DeviceSettingsPreferenceConst.PREF_HEARTRATE_ALERT_LOW_THRESHOLD,
|
||||||
heartRate.getHeartRateAlarmLow().getAlarmLowEnabled() ? heartRate.getHeartRateAlarmLow().getAlarmLowThreshold() : 0
|
String.valueOf(heartRate.getHeartRateAlarmLow().getAlarmLowEnabled() ? heartRate.getHeartRateAlarmLow().getAlarmLowThreshold() : 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
getSupport().evaluateGBDeviceEvent(eventUpdatePreferences);
|
getSupport().evaluateGBDeviceEvent(eventUpdatePreferences);
|
||||||
|
Loading…
Reference in New Issue
Block a user