health - Adds 3 minute setting
parent
e997ad59ed
commit
2f531799db
|
|
@ -8,3 +8,4 @@
|
|||
0.07: Added coloured bar charts
|
||||
0.08: Suppress bleed through of E.showMenu's when displaying bar charts
|
||||
0.09: Fix file naming so months are 1-based (not 0) (fix #1119)
|
||||
0.10: Adds additional 3 minute setting for HRM
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ function menuSettings() {
|
|||
"< Back":()=>menuMain(),
|
||||
"Heart Rt":{
|
||||
value : 0|s.hrm,
|
||||
min : 0, max : 2,
|
||||
format : v=>["Off","10 mins","Always"][v],
|
||||
min : 0, max : 3,
|
||||
format : v=>["Off","3 mins","10 mins","Always"][v],
|
||||
onchange : v => { s.hrm=v;setSettings(s); }
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,18 +1,28 @@
|
|||
(function(){
|
||||
var settings = require("Storage").readJSON("health.json",1)||{};
|
||||
var hrm = 0|settings.hrm;
|
||||
if (hrm==1) {
|
||||
function onHealth() {
|
||||
Bangle.setHRMPower(1, "health");
|
||||
setTimeout(()=>Bangle.setHRMPower(0, "health"),2*60000); // give it 2 minutes
|
||||
var settings = require("Storage").readJSON("health.json",1)||{};
|
||||
var hrm = 0|settings.hrm;
|
||||
if (hrm == 1 || hrm == 2) {
|
||||
function onHealth() {
|
||||
Bangle.setHRMPower(1, "health");
|
||||
setTimeout(()=>Bangle.setHRMPower(0, "health"),hrm*60000); // give it 1 minute detection time for 3 min setting and 2 minutes for 10 min setting
|
||||
if (hrm == 1){
|
||||
for (var i = 1; i <= 2; i++){
|
||||
setTimeout(()=>{
|
||||
Bangle.setHRMPower(1, "health");
|
||||
setTimeout(()=>{
|
||||
Bangle.setHRMPower(0, "health");
|
||||
}, (i * 200000) + 60000);
|
||||
}, (i * 200000));
|
||||
}
|
||||
}
|
||||
Bangle.on("health", onHealth);
|
||||
Bangle.on('HRM', h => {
|
||||
if (h.confidence>80) Bangle.setHRMPower(0, "health");
|
||||
});
|
||||
if (Bangle.getHealthStatus().bpmConfidence) return;
|
||||
onHealth();
|
||||
} else Bangle.setHRMPower(hrm!=0, "health");
|
||||
}
|
||||
Bangle.on("health", onHealth);
|
||||
Bangle.on('HRM', h => {
|
||||
if (h.confidence>80) Bangle.setHRMPower(0, "health");
|
||||
});
|
||||
if (Bangle.getHealthStatus().bpmConfidence) return;
|
||||
onHealth();
|
||||
} else Bangle.setHRMPower(hrm!=0, "health");
|
||||
})();
|
||||
|
||||
Bangle.on("health", health => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "health",
|
||||
"name": "Health Tracking",
|
||||
"version": "0.09",
|
||||
"version": "0.10",
|
||||
"description": "Logs health data and provides an app to view it (requires firmware 2v10.100 or later)",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,system,health",
|
||||
|
|
|
|||
Loading…
Reference in New Issue