File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 11( function ( ) {
2-
3- const intervalLow = 30000 ; // update interval when not charging
4- const intervalHigh = 30000 ; // faster update when charging
2+
53 var showPercent = false ;
64 const width = 40 ;
75 const height = 24 ;
5755 g . setFont ( '6x8' ) ;
5856 g . drawString ( txt , x + 14 , y + 10 ) ;
5957
60- if ( Bangle . isCharging ( ) ) changeInterval ( id , intervalHigh ) ;
61- else changeInterval ( id , intervalLow ) ;
58+
6259}
6360 WIDGETS [ "widsmartbatt" ] = {
6461 area : "tr" ,
8077 if ( w . x - oversize <= x && x < w . x + width + oversize
8178 && w . y - oversize <= y && y < w . y + height + oversize ) {
8279 E . stopEventPropagation && E . stopEventPropagation ( ) ;
80+ Bangle . buzz ( 20 ) ;
8381 showPercent = true ;
8482 setTimeout ( ( ) => {
8583 showPercent = false ;
9391 Bangle . on ( 'charging' , function ( ) {
9492 WIDGETS [ "widsmartbatt" ] . draw ( ) ;
9593 } ) ;
96-
97- var id = setInterval ( ( ) => WIDGETS [ "widsmartbatt" ] . draw ( ) , intervalLow ) ;
94+ //draw once per minute...
95+ var id = setInterval ( ( ) => WIDGETS [ "widsmartbatt" ] . draw ( ) , 60000 ) ;
9896
9997
10098} ) ( ) ;
You can’t perform that action at this time.
0 commit comments