File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -161,17 +161,13 @@ if (global.sleeplog.conf.enabled) {
161161 // add preliminary status depending on charging and movement thresholds
162162 // 1 = not worn, 2 = awake, 3 = light sleep, 4 = deep sleep
163163 if ( data . bpm ) {
164- if ( ! Bangle . isCharging ( ) ) {
165- if ( data . bpm <= global . sleeplog . conf . hrmDeepTh ) data . status = 4 ;
166- else if ( data . bpm <= global . sleeplog . conf . hrmLightTh ) data . status = 3 ;
167- else data . status = 2 ;
168- } else data . status = 1 ;
169- } else {
170- if ( ! Bangle . isCharging ( ) ) {
171- if ( data . movement <= global . sleeplog . conf . deepTh ) data . status = 4 ;
172- else if ( data . movement <= global . sleeplog . conf . lightTh ) data . status = 3 ;
173- else data . status = 2 ;
174- } else data . status = 1 ;
164+ data . status = Bangle . isCharging ( ) ? 1 :
165+ data . bpm <= global . sleeplog . conf . hrmDeepTh ? 4 :
166+ data . bpm <= global . sleeplog . conf . hrmLightTh ? 3 : 2 ;
167+ } else {
168+ data . status = Bangle . isCharging ( ) ? 1 :
169+ data . movement <= global . sleeplog . conf . deepTh ? 4 :
170+ data . movement <= global . sleeplog . conf . lightTh ? 3 : 2 ;
175171 }
176172
177173 // check if changing to deep sleep from non sleeping
You can’t perform that action at this time.
0 commit comments