diff --git a/apps/sleeplog/boot.js b/apps/sleeplog/boot.js index 6e0c02419..2660fcad6 100644 --- a/apps/sleeplog/boot.js +++ b/apps/sleeplog/boot.js @@ -13,7 +13,6 @@ global.sleeplog = { minConsec: 18E5, // [ms] minimal time to count for consecutive sleep deepTh: 100, // threshold for deep sleep lightTh: 200, // threshold for light sleep - tempWearCheck: false, // use temperature to detect if worn wearTemp: 29, // temperature threshold to count as worn }, require("Storage").readJSON("sleeplog.json", true) || {}) }; @@ -181,7 +180,7 @@ if (sleeplog.conf.enabled) { // check wearing status either based on HRM or temperature as set in settings checkIsWearing: function(returnFn, data) { - if (this.conf.tempWearCheck) { + if (!!this.conf.wearTemp) { return returnFn(!Bangle.isCharging() && E.getTemperature() >= this.conf.wearTemp, data); } diff --git a/apps/sleeplog/settings.js b/apps/sleeplog/settings.js index d23a6369a..6ec52e2dc 100644 --- a/apps/sleeplog/settings.js +++ b/apps/sleeplog/settings.js @@ -13,7 +13,6 @@ minConsec: 18E5, // [ms] minimal time to count for consecutive sleep deepTh: 100, // threshold for deep sleep lightTh: 200, // threshold for light sleep - tempWearCheck: false, // use temperature to detect if worn wearTemp: 29, // temperature threshold to count as worn // app settings breakToD: 12, // [h] time of day when to start/end graphs @@ -350,13 +349,14 @@ /*LANG*/"Wear Temperature": { value: settings.wearTemp, step: 0.5, - min: 20, + min: 19.5, max: 40, wrap: true, noList: true, format: v => v + "°C", + format: v => v === 19.5 ? "Disabled" : v + "°C", onchange: v => { - settings.wearTemp = v; + settings.wearTemp = v === 19.5 ? null : v; writeSetting(); } }, @@ -436,12 +436,6 @@ require("sleeplog").setEnabled(v); } }, - /*LANG*/"Wear detection using temperature": { - value: settings.tempWearCheck, - onchange: v => { - settings.tempWearCheck = v; - } - }, /*LANG*/"Debugging": { value: debugImg, onchange: () => setTimeout(showDebug, 10)