mirror of https://github.com/espruino/BangleApps
autoreset: bootloader app - universal timeout to clock face
parent
d35ee5a142
commit
5240c4b1d3
|
@ -0,0 +1 @@
|
|||
0.01: New App!
|
|
@ -0,0 +1,21 @@
|
|||
# Auto Reset
|
||||
|
||||
Sets a timeout to load the clock face. The timeout is stopped and started again upon user input.
|
||||
|
||||
## Usage
|
||||
|
||||
Install with app loader and Auto Reset will run in background. If you don't interact with the watch it will time out to the clock face after 10 minutes.
|
||||
|
||||
## TODO
|
||||
|
||||
- Add settings page
|
||||
- set how many minutes the timeout should count down.
|
||||
- whitelist/blacklist for apps.
|
||||
|
||||
## Requests
|
||||
|
||||
Mention @thyttan in an issue on the espruino/BangleApps repo for bug reports and feature requests.
|
||||
|
||||
## Creator
|
||||
|
||||
thyttan
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
let timeoutAutoreset;
|
||||
let resetTimeoutAutoreset = (force)=>{
|
||||
if (timeoutAutoreset) clearTimeout(timeoutAutoreset);
|
||||
setTimeout(()=>{ // Short outer timeout to make sure we have time to leave clock face before checking `Bangle.CLOCK!=1`.
|
||||
if (Bangle.CLOCK!=1) { // Only add timeout if not already on clock face.
|
||||
timeoutAutoreset = setTimeout(()=>{
|
||||
if (Bangle.CLOCK!=1) Bangle.showClock();
|
||||
}, 10*60*1000);
|
||||
}
|
||||
},200);
|
||||
};
|
||||
|
||||
Bangle.on('touch', resetTimeoutAutoreset);
|
||||
Bangle.on('swipe', resetTimeoutAutoreset);
|
||||
Bangle.on('message', resetTimeoutAutoreset);
|
||||
setWatch(resetTimeoutAutoreset, BTN, {repeat:true, edge:'rising'});
|
||||
|
||||
if (Bangle.CLOCK!=1) resetTimeoutAutoreset();
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{ "id": "autoreset",
|
||||
"name": "Auto Reset",
|
||||
"version":"0.01",
|
||||
"description": "Sets a timeout to load the clock face. The timeout is stopped and started again upon user input.",
|
||||
"icon": "app.png",
|
||||
"type": "bootloader",
|
||||
"tags": "system",
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"storage": [
|
||||
{"name":"autoreset.boot.js","url":"boot.js"}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue