settings 0.45: Add calibrate battery option

pull/1869/head
Gordon Williams 2022-05-23 11:16:40 +01:00
parent d3a0128bc8
commit 1b290a6982
4 changed files with 16 additions and 2 deletions

View File

@ -48,3 +48,4 @@
0.43: Add some Bangle 1 colours to theme customizer 0.43: Add some Bangle 1 colours to theme customizer
0.44: Add "Start Week On X" option (#1780) 0.44: Add "Start Week On X" option (#1780)
UI improvements to Locale and Date & Time menu UI improvements to Locale and Date & Time menu
0.45: Add calibrate battery option

View File

@ -13,7 +13,6 @@ This is Bangle.js's settings menu
* **LCD** Configure settings about the screen. How long it stays on, how bright it is, and when it turns on - see below. * **LCD** Configure settings about the screen. How long it stays on, how bright it is, and when it turns on - see below.
* **Theme** Adjust the colour scheme * **Theme** Adjust the colour scheme
* **Utils** Utilities - including resetting settings (see below) * **Utils** Utilities - including resetting settings (see below)
* **Turn Off** Turn Bangle.js off
## BLE - Bluetooth Settings ## BLE - Bluetooth Settings
@ -61,5 +60,7 @@ The exact effects depend on the app. In general the watch will not wake up by i
* **Compact Storage** Removes deleted/old files from Storage - this will speed up your Bangle.js * **Compact Storage** Removes deleted/old files from Storage - this will speed up your Bangle.js
* **Rewrite Settings** Should not normally be required, but if `.boot0` has been deleted/corrupted (and so no settings are being loaded) this will fix it. * **Rewrite Settings** Should not normally be required, but if `.boot0` has been deleted/corrupted (and so no settings are being loaded) this will fix it.
* **Flatten Battery** Turns on all devices and draws as much power as possible, attempting to flatten the Bangle.js battery. This can still take 5+ hours. * **Flatten Battery** Turns on all devices and draws as much power as possible, attempting to flatten the Bangle.js battery. This can still take 5+ hours.
* **Calibrate Battery** If you're finding your battery percentage meter isn't accurate, leave your Bangle.js on charge for at least 3 hours, and then choose this menu option. It will measure the battery voltage when full and will allow Bangle.js to report a more accurate battery percentage.
* **Reset Settings** Reset the settings (as set in this app) to defaults. Does not reset settings for other apps. * **Reset Settings** Reset the settings (as set in this app) to defaults. Does not reset settings for other apps.
* **Factory Reset** (not available on Bangle.js 1) - wipe **everything** and return to a factory state * **Factory Reset** (not available on Bangle.js 1) - wipe **everything** and return to a factory state
* **Turn Off** Turn Bangle.js off

View File

@ -1,7 +1,7 @@
{ {
"id": "setting", "id": "setting",
"name": "Settings", "name": "Settings",
"version": "0.44", "version": "0.45",
"description": "A menu for setting up Bangle.js", "description": "A menu for setting up Bangle.js",
"icon": "settings.png", "icon": "settings.png",
"tags": "tool,system", "tags": "tool,system",

View File

@ -546,6 +546,18 @@ function showUtilMenu() {
var i=1000;while (i--); var i=1000;while (i--);
}, 1); }, 1);
}, },
/*LANG*/'Calibrate Battery': () => {
E.showPrompt(/*LANG*/"Is the battery fully charged?",{title:/*LANG*/"Calibrate"}).then(ok => {
if (ok) {
var s=require("Storage").readJSON("setting.json");
s.batFullVoltage = (analogRead(D3)+analogRead(D3)+analogRead(D3)+analogRead(D3))/4;
require("Storage").writeJSON("setting.json",s);
E.showAlert(/*LANG*/"Calibrated!").then(() => load("settings.app.js"));
} else {
E.showAlert(/*LANG*/"Please charge Bangle.js for 3 hours and try again").then(() => load("settings.app.js"));
}
});
},
/*LANG*/'Reset Settings': () => { /*LANG*/'Reset Settings': () => {
E.showPrompt(/*LANG*/'Reset to Defaults?',{title:/*LANG*/"Settings"}).then((v) => { E.showPrompt(/*LANG*/'Reset to Defaults?',{title:/*LANG*/"Settings"}).then((v) => {
if (v) { if (v) {