mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-07-21 14:21:03 +02:00
Xiaomi: Fix sleep mode schedule, spo2 and stress support detection
This commit is contained in:
parent
8d1c243297
commit
a3e2997f26
|
@ -373,7 +373,13 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||||
// Health
|
// Health
|
||||||
//
|
//
|
||||||
settings.add(R.xml.devicesettings_header_health);
|
settings.add(R.xml.devicesettings_header_health);
|
||||||
|
if (supportsStressMeasurement() && supports(device, FEAT_STRESS) && supportsSpo2() && supports(device, FEAT_SPO2)) {
|
||||||
settings.add(R.xml.devicesettings_heartrate_sleep_alert_activity_stress_spo2);
|
settings.add(R.xml.devicesettings_heartrate_sleep_alert_activity_stress_spo2);
|
||||||
|
} else if (supportsStressMeasurement() && supports(device, FEAT_STRESS)) {
|
||||||
|
settings.add(R.xml.devicesettings_heartrate_sleep_alert_activity_stress);
|
||||||
|
} else {
|
||||||
|
settings.add(R.xml.devicesettings_heartrate_sleep_activity);
|
||||||
|
}
|
||||||
if (supports(device, FEAT_INACTIVITY)) {
|
if (supports(device, FEAT_INACTIVITY)) {
|
||||||
settings.add(R.xml.devicesettings_inactivity_dnd_no_threshold);
|
settings.add(R.xml.devicesettings_inactivity_dnd_no_threshold);
|
||||||
}
|
}
|
||||||
|
|
|
@ -591,6 +591,7 @@ public class XiaomiScheduleService extends AbstractXiaomiService {
|
||||||
final String end = XiaomiPreferences.prefFromHourMin(sleepMode.getSchedule().getEnd());
|
final String end = XiaomiPreferences.prefFromHourMin(sleepMode.getSchedule().getEnd());
|
||||||
|
|
||||||
final GBDeviceEventUpdatePreferences eventUpdatePreferences = new GBDeviceEventUpdatePreferences()
|
final GBDeviceEventUpdatePreferences eventUpdatePreferences = new GBDeviceEventUpdatePreferences()
|
||||||
|
.withPreference(XiaomiPreferences.FEAT_SLEEP_MODE_SCHEDULE, true)
|
||||||
.withPreference("prefs_enable_sleep_time", null)
|
.withPreference("prefs_enable_sleep_time", null)
|
||||||
.withPreference(DeviceSettingsPreferenceConst.PREF_SLEEP_MODE_SCHEDULE_ENABLED, sleepMode.getEnabled())
|
.withPreference(DeviceSettingsPreferenceConst.PREF_SLEEP_MODE_SCHEDULE_ENABLED, sleepMode.getEnabled())
|
||||||
.withPreference(DeviceSettingsPreferenceConst.PREF_SLEEP_MODE_SCHEDULE_START, start)
|
.withPreference(DeviceSettingsPreferenceConst.PREF_SLEEP_MODE_SCHEDULE_START, start)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user