[ActivityReminder] Add temperature threshold to detect when the watch isn't worn

pull/1891/head
Stiralbios 2022-05-26 21:21:15 +02:00
parent 6e88874d41
commit 358b06fd6c
6 changed files with 17 additions and 3 deletions

View File

@ -3,3 +3,4 @@
0.03: Do not alarm while charging 0.03: Do not alarm while charging
0.04: Obey system quiet mode 0.04: Obey system quiet mode
0.05: Battery optimisation, add the pause option, bug fixes 0.05: Battery optimisation, add the pause option, bug fixes
0.06: Add a temperature threshold to detect (and not alert) if the BJS isn't worn. Better support for the peoples using the app at night

View File

@ -11,4 +11,5 @@ Different settings can be personalized:
- Dismiss delay: Delay added before the next alert if the alert is dismissed. From 5 to 60 min - Dismiss delay: Delay added before the next alert if the alert is dismissed. From 5 to 60 min
- Pause delay: Same as Dismiss delay but longer (usefull for meetings and such). From 30 to 240 min - Pause delay: Same as Dismiss delay but longer (usefull for meetings and such). From 30 to 240 min
- Min steps: Minimal amount of steps to count as an activity - Min steps: Minimal amount of steps to count as an activity
- Temp Threshold: Temperature threshold to determine if the watch is worn

View File

@ -25,7 +25,7 @@ function run() {
function isNotWorn() { function isNotWorn() {
// todo in a futur release check temperature and mouvement in a futur release // todo in a futur release check temperature and mouvement in a futur release
return Bangle.isCharging(); return (Bangle.isCharging() || activityreminder_settings.tempThreshold <= E.getTemperature());
} }
function isDuringAlertHours(h) { function isDuringAlertHours(h) {

View File

@ -8,7 +8,8 @@ exports.loadSettings = function () {
maxInnactivityMin: 30, maxInnactivityMin: 30,
dismissDelayMin: 15, dismissDelayMin: 15,
pauseDelayMin: 120, pauseDelayMin: 120,
minSteps: 50 minSteps: 50,
tempThreshold: 27
}, storage.readJSON("activityreminder.s.json", true) || {}); }, storage.readJSON("activityreminder.s.json", true) || {});
}; };

View File

@ -3,7 +3,7 @@
"name": "Activity Reminder", "name": "Activity Reminder",
"shortName":"Activity Reminder", "shortName":"Activity Reminder",
"description": "A reminder to take short walks for the ones with a sedentary lifestyle", "description": "A reminder to take short walks for the ones with a sedentary lifestyle",
"version":"0.05", "version":"0.06",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",
"tags": "tool,activity", "tags": "tool,activity",

View File

@ -71,6 +71,17 @@
settings.minSteps = v; settings.minSteps = v;
activityreminder.writeSettings(settings); activityreminder.writeSettings(settings);
} }
},
'Temp Threshold': {
value: settings.tempThreshold,
step: 0.5,
min: 20,
max: 40,
format: v => v + "°C",
onchange: v => {
settings.tempThreshold = v;
activityreminder.writeSettings(settings);
}
} }
}); });
}) })