1
0
Fork 0

lightswitch: fix tap listener widget assumption

master
Rob Pilling 2023-09-11 17:51:39 +01:00 committed by thyttan
parent 0b96c2f063
commit 8209dcbf28
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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",
@ -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,

View File

@ -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": [