Fix battery ...again

pull/1540/head
Stergios Mekras 2022-03-03 20:15:32 +01:00
parent 7a8f3d9bd9
commit fd9fb6cba4
2 changed files with 6 additions and 14 deletions

View File

@ -99,7 +99,7 @@ function draw() {
g.drawImage(background);
const color = getBatteryColor(batLevel);
const bat;
const bat = "";
const d = new Date();
const day = d.getDate();
const month = d.getMonth() + 1;
@ -111,9 +111,9 @@ function draw() {
const time = d02(h) + ":" + d02(m);
if (E.getBattery() < 100) {
bat = d02(E.getBattery()) + "%"
bat = d02(E.getBattery()) + "%";
} else {
bat = E.getBattery() + "%"
bat = E.getBattery() + "%";
}
g.reset();
@ -146,6 +146,8 @@ function draw() {
loadSettings();
console.log(settings);
g.clear();
pollBattery();

View File

@ -6,17 +6,7 @@
var FILE = "smclock.json";
// load settings from the file
// assign default values if it doesn't exist
var settings = Object.assign(
{
dateFormat: "Short",
drawInterval: 10,
pollInterval: 60,
showAnalogFace: false,
showWeekInfo: false,
useVectorFont: false,
},
require("Storage").readJSON(FILE, true) || {}
);
var settings = Object.assign(require("Storage").readJSON(FILE, true) || {});
// write the new settings to the file
function writeSettings() {