drained: rename from low-power-mode

pull/2684/head
Rob Pilling 2023-04-07 17:52:54 +01:00
parent 4bb96f314c
commit 1fa36bd2b8
7 changed files with 14 additions and 14 deletions

View File

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

View File

@ -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();

View File

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

View File

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

View File

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

View File

@ -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"}
]
}