Skip to content

Commit 375ca0b

Browse files
authored
Update heart rate monitoring logic in boot.js
1 parent 90e6ecf commit 375ca0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/sleeplog/boot.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ if (global.sleeplog.conf.enabled) {
163163

164164
// add preliminary status depending on charging and movement thresholds
165165
// 1 = not worn, 2 = awake, 3 = light sleep, 4 = deep sleep
166-
if(data.hrm){
166+
if(data.bpm){
167167
if (!Bangle.isCharging()) {
168-
if (data.heartRate <= global.sleeplog.conf.hrmDeepTh) data.status = 4;
169-
else if (data.heartRate <= global.sleeplog.conf.hrmLightTh) data.status = 3;
168+
if (data.bpm <= global.sleeplog.conf.hrmDeepTh) data.status = 4;
169+
else if (data.bpm <= global.sleeplog.conf.hrmLightTh) data.status = 3;
170170
else data.status = 2;
171171
} else data.status = 1;
172172
} else {
@@ -177,7 +177,7 @@ if (global.sleeplog.conf.enabled) {
177177
} else data.status = 1;
178178
}
179179

180-
console.log("HRM:", data.hrm, "HR:", data.heartRate, "Movement:", data.movement, "Status:", data.status);
180+
181181

182182

183183
// check if changing to deep sleep from non sleeping

0 commit comments

Comments
 (0)