forked from FOSS/BangleApps
commit
75066fae86
|
@ -1,2 +1,3 @@
|
||||||
0.01: New Widget!
|
0.01: New Widget!
|
||||||
0.02: Fix calling null on draw
|
0.02: Fix calling null on draw
|
||||||
|
0.03: Only vibrate during work
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "widtwenties",
|
"id": "widtwenties",
|
||||||
"name": "Twenties",
|
"name": "Twenties",
|
||||||
"shortName": "twenties",
|
"shortName": "twenties",
|
||||||
"version": "0.02",
|
"version": "0.03",
|
||||||
"description": "Buzzes every 20m to stand / sit and look 20ft away for 20s.",
|
"description": "Buzzes every 20m to stand / sit and look 20ft away for 20s.",
|
||||||
"icon": "widget.png",
|
"icon": "widget.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
|
|
|
@ -7,9 +7,15 @@ they don't interfere with currently-running apps */
|
||||||
const look = 20 * 1000; // 20 seconds
|
const look = 20 * 1000; // 20 seconds
|
||||||
|
|
||||||
buzz = _ => {
|
buzz = _ => {
|
||||||
Bangle.buzz().then(_ => {
|
const date = new Date();
|
||||||
setTimeout(Bangle.buzz, look);
|
const day = date.getDay();
|
||||||
});
|
const hour = date.getHours();
|
||||||
|
// buzz at work
|
||||||
|
if (day <= 5 && hour >= 8 && hour <= 17) {
|
||||||
|
Bangle.buzz().then(_ => {
|
||||||
|
setTimeout(Bangle.buzz, look);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// add widget
|
// add widget
|
||||||
|
@ -21,4 +27,4 @@ they don't interfere with currently-running apps */
|
||||||
setInterval(WIDGETS.twenties.buzz, move); // buzz to stand / sit
|
setInterval(WIDGETS.twenties.buzz, move); // buzz to stand / sit
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Bangle.drawWidgets(); // <-- for development only
|
// Bangle.drawWidgets(); // <-- for development only
|
||||||
|
|
Loading…
Reference in New Issue