forked from FOSS/BangleApps
commit
064eade0eb
|
@ -1 +1,2 @@
|
||||||
0.01: First version
|
0.01: First version
|
||||||
|
0.02: Support for Bangle.js 2
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ "id": "widdevst",
|
{ "id": "widdevst",
|
||||||
"name": "Device Status Widget",
|
"name": "Device Status Widget",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "Shows power status of Bluetooth, Compass, GPS and Heart Rate Monitor as well as storage and memory usage.",
|
"description": "Shows power status of Bluetooth, Compass, GPS and Heart Rate Monitor as well as storage and memory usage.",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"tags": "widget,bluetooth,compass,gps,hrm",
|
"tags": "widget,bluetooth,compass,gps,hrm",
|
||||||
"supports": ["BANGLEJS"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name": "widdevst.wid.js", "url": "wid.js"}
|
{"name": "widdevst.wid.js", "url": "wid.js"}
|
||||||
|
|
|
@ -24,12 +24,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var draw = WIDGETS.devst.draw.bind(WIDGETS.devst);
|
var draw = WIDGETS.devst.draw.bind(WIDGETS.devst);
|
||||||
var iid = setInterval(draw, 2000);
|
var iid = setInterval(draw, Bangle.isLocked() ? 6e4 : 2e3);
|
||||||
|
|
||||||
Bangle.on('lcdPower', (on) => {
|
Bangle.on('lcdPower', (on) => {
|
||||||
if (on) {
|
if (on) {
|
||||||
draw();
|
draw();
|
||||||
if (!iid) iid = setInterval(draw, 2000);
|
if (!iid) iid = setInterval(draw, Bangle.isLocked() ? 6e4 : 2e3);
|
||||||
} else if (iid) iid = clearInterval(iid);
|
} else if (iid) iid = clearInterval(iid);
|
||||||
});
|
});
|
||||||
|
Bangle.on('lock', (on) => {
|
||||||
|
if (iid) {
|
||||||
|
clearInterval(iid);
|
||||||
|
iid = setInterval(draw, on ? 6e4 : 2e3);
|
||||||
|
}
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue