File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 14140.16: Only write logs if we have a non-empty log to write
15150.17: Minor code improvements
16160.18: Add back as a function to prevent translation making it a menu entry
17+ 0.19: Write sleep state into health event's .activity field
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ if (global.sleeplog.conf.enabled) {
2525 start : function ( ) {
2626 // add kill and health listener
2727 E . on ( 'kill' , global . sleeplog . saveStatus ) ;
28- Bangle . on ( 'health' , global . sleeplog . health ) ;
28+ Bangle . prependListener ( 'health' , global . sleeplog . health ) ;
2929
3030 // restore saved status
3131 this . restoreStatus ( ) ;
@@ -176,6 +176,9 @@ if (global.sleeplog.conf.enabled) {
176176 // set status
177177 global . sleeplog . setStatus ( data ) ;
178178 }
179+ // update activity in the 'health' event for when it's logged/sent to Gadgetbridge
180+ if ( data . status == 3 ) data . activity = "LIGHT_SLEEP" ;
181+ if ( data . status == 4 ) data . activity = "DEEP_SLEEP" ;
179182 } ,
180183
181184 // check wearing status either based on HRM or temperature as set in settings
Original file line number Diff line number Diff line change 22 "id" :" sleeplog" ,
33 "name" :" Sleep Log" ,
44 "shortName" : " SleepLog" ,
5- "version" : " 0.18 " ,
5+ "version" : " 0.19 " ,
66 "description" : " Log and view your sleeping habits. This app is using the built in movement calculation." ,
77 "icon" : " app.png" ,
88 "type" : " app" ,
You can’t perform that action at this time.
0 commit comments