Let's only register HRM and battery events when respective circle is visible

pull/1237/head
Marco Heiming 2022-01-05 15:35:01 +01:00
parent 639bc1962e
commit 801237b2cf
1 changed files with 18 additions and 17 deletions

View File

@ -280,18 +280,17 @@ Bangle.on('lock', function(isLocked) {
drawHeartRate();
}
}
if (isCircleEnabled("steps")) drawSteps();
if (isCircleEnabled("stepsDistance")) drawStepsDistance();
} else {
if (isCircleEnabled("hr")) {
Bangle.setHRMPower(0, "watch");
}
}
if (isCircleEnabled("hr")) drawHeartRate();
if (isCircleEnabled("steps")) drawSteps();
if (isCircleEnabled("stepsDistance")) drawStepsDistance();
});
Bangle.on('HRM', function(hrm) {
if (isCircleEnabled("hr")) {
Bangle.on('HRM', function(hrm) {
//if(hrm.confidence > 90){
hrtValue = hrm.bpm;
if (Bangle.isLCDOn())
@ -299,12 +298,14 @@ Bangle.on('HRM', function(hrm) {
//} else {
// hrtValue = undefined;
//}
});
}
});
if (isCircleEnabled("battery")) {
Bangle.on('charging', function(charging) {
if (isCircleEnabled("battery")) drawBattery();
drawBattery();
});
}
g.clear();