File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 880.08: Ensure boot code doesn't allocate and leave a gloval variable named 'settings'
990.09: Handle lightswitch logic running before its widget has loaded
10100.10: Minor code improvements
11+ 0.11: Fix issue where backlight is not turned on.
Original file line number Diff line number Diff line change @@ -10,13 +10,17 @@ exports = {
1010 unlockSide : "" ,
1111 tapSide : "right" ,
1212 tapOn : "always" ,
13+ isOn : true
1314 } , require ( "Storage" ) . readJSON ( "lightswitch.json" , true ) || { } ) ;
1415
1516 // cache lock status
1617 var locked = Bangle . isLocked ( ) ;
1718
1819 // check to unlock
19- if ( locked && data . dir === w . unlockSide ) Bangle . setLocked ( ) ;
20+ if ( locked && data . dir === w . unlockSide ) {
21+ Bangle . setLocked ( ) ;
22+ if ( w . isOn ) Bangle . setLCDPower ( true ) ;
23+ }
2024
2125 // check to flash
2226 if ( data . dir === w . tapSide && ( w . tapOn === "always" || locked === ( w . tapOn === "locked" ) ) ) require ( "lightswitch.js" ) . flash ( ) ;
@@ -38,13 +42,14 @@ exports = {
3842 isOn : true
3943 } , require ( "Storage" ) . readJSON ( "lightswitch.json" , true ) || { } ) ;
4044
41- // chack if locked, backlight off or actual value lower then minimal flash value
45+ // check if locked, backlight off or actual value lower then minimal flash value
4246 if ( Bangle . isLocked ( ) || ! w . isOn || w . value < w . minFlash ) {
4347
4448 // set inner bulb and brightness
4549 var setBrightness = function ( w , value ) {
4650 if ( w . drawInnerBulb ) w . drawInnerBulb ( value ) ;
4751 Bangle . setLCDBrightness ( value ) ;
52+ Bangle . setLCDPower ( true ) ;
4853 } ;
4954
5055 // override timeout if defined
Original file line number Diff line number Diff line change 22 "id" : " lightswitch" ,
33 "name" : " Light Switch Widget" ,
44 "shortName" : " Light Switch" ,
5- "version" : " 0.10 " ,
5+ "version" : " 0.11 " ,
66 "description" : " A fast way to switch LCD backlight on/off, change the brightness and show the lock status. All in one widget." ,
77 "icon" : " images/app.png" ,
88 "screenshots" : [
Original file line number Diff line number Diff line change 121121 } else {
122122 // activate backlight
123123 this . isOn = true ;
124+ Bangle . setLCDPower ( true ) ;
124125 // redraw complete widget icon
125126 this . drawIcon ( false ) ;
126127 }
You can’t perform that action at this time.
0 commit comments