Skip to content

Commit

Permalink
lightswitch: fix tap listener widget assumption
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling authored and thyttan committed Sep 12, 2023
1 parent 0b96c2f commit 8209dcb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apps/lightswitch/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
0.05: Prevent drawing into app area.
0.06: Fix issue where .draw was being called by reference (not allowing widgets to be hidden)
0.07: Handle the swipe event that is generated when draging to change light intensity, so it doesn't trigger some other swipe handler.
0.08: Ensure boot code doesn't allocate and leave a gloval variable named 'settings'
0.08: Ensure boot code doesn't allocate and leave a gloval variable named 'settings'
0.09: Handle lightswitch logic running before its widget has loaded
4 changes: 2 additions & 2 deletions apps/lightswitch/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports = {
// check for double tap and direction
if (data.double) {
// setup shortcut to this widget or load from storage
var w = global.WIDGETS ? WIDGETS.lightswitch : Object.assign({
var w = global.WIDGETS && WIDGETS.lightswitch || Object.assign({
unlockSide: "",
tapSide: "right",
tapOn: "always",
Expand All @@ -31,7 +31,7 @@ exports = {
// function to flash backlight
flash: function(tOut) {
// setup shortcut to this widget or load from storage
var w = global.WIDGETS ? WIDGETS.lightswitch : Object.assign({
var w = global.WIDGETS && WIDGETS.lightswitch || Object.assign({
tOut: 3000,
minFlash: 0.2,
value: 1,
Expand Down
2 changes: 1 addition & 1 deletion apps/lightswitch/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "lightswitch",
"name": "Light Switch Widget",
"shortName": "Light Switch",
"version": "0.08",
"version": "0.09",
"description": "A fast way to switch LCD backlight on/off, change the brightness and show the lock status. All in one widget.",
"icon": "images/app.png",
"screenshots": [
Expand Down

0 comments on commit 8209dcb

Please sign in to comment.