mirror of https://github.com/espruino/BangleApps
drained: rename from low-power-mode
parent
4bb96f314c
commit
1fa36bd2b8
|
@ -1,4 +1,4 @@
|
|||
# Low Power Mode
|
||||
# Drained
|
||||
|
||||
With this app installed, your Bangle will automatically switch into low power mode when the battery reaches a specified threshold, displaying a simple clock.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
if (typeof lowpowerInterval !== "undefined")
|
||||
lowpowerInterval = clearInterval(lowpowerInterval);
|
||||
if (typeof drainedInterval !== "undefined")
|
||||
drainedInterval = clearInterval(drainedInterval);
|
||||
Bangle.setLCDBrightness(0);
|
||||
Bangle.setGPSPower = Bangle.setHRMPower = function (_val, _name) { return false; };
|
||||
Bangle.removeAllListeners();
|
|
@ -1,6 +1,6 @@
|
|||
// from boot.js
|
||||
if(typeof lowpowerInterval !== "undefined")
|
||||
lowpowerInterval = clearInterval(lowpowerInterval) as undefined;
|
||||
if(typeof drainedInterval !== "undefined")
|
||||
drainedInterval = clearInterval(drainedInterval) as undefined;
|
||||
|
||||
// backlight
|
||||
Bangle.setLCDBrightness(0);
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
var lowpowerInterval = setInterval(function () {
|
||||
var drainedInterval = setInterval(function () {
|
||||
if (Bangle.isCharging())
|
||||
return;
|
||||
if (E.getBattery() > 5)
|
||||
return;
|
||||
load("lowpower.app.js");
|
||||
load("drained.app.js");
|
||||
}, 5 * 60 * 1000);
|
|
@ -1,8 +1,8 @@
|
|||
let lowpowerInterval: number | undefined = setInterval(() => {
|
||||
let drainedInterval: number | undefined = setInterval(() => {
|
||||
if(Bangle.isCharging())
|
||||
return;
|
||||
if(E.getBattery() > 5)
|
||||
return;
|
||||
|
||||
load("lowpower.app.js");
|
||||
load("drained.app.js");
|
||||
}, 5 * 60 * 1000);
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"id": "lowpower",
|
||||
"name": "Low Power Mode",
|
||||
"id": "drained",
|
||||
"name": "Drained",
|
||||
"version": "0.01",
|
||||
"description": "Switches to displaying a simple clock when the battery percentage is low, nothing more",
|
||||
"description": "Switches to displaying a simple clock when the battery percentage is low, and disables some peripherals",
|
||||
"readme": "README.md",
|
||||
"icon": "TODOOOOOOOOOOOOOOOO.png",
|
||||
"type": "clock",
|
||||
"tags": "clock",
|
||||
"supports": ["BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"lowpower.boot.js","url":"boot.js"},
|
||||
{"name":"lowpower.app.js","url":"app.js"}
|
||||
{"name":"drained.boot.js","url":"boot.js"},
|
||||
{"name":"drained.app.js","url":"app.js"}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue