weatherclock v0.06

master
lunctis-viribus 2023-02-26 16:59:43 +01:00
parent b7222c485b
commit 7809129ddf
4 changed files with 11 additions and 9 deletions

View File

@ -3,4 +3,4 @@
0.03: Minor layout extra spaces. 0.03: Minor layout extra spaces.
0.04: Layout now compatible with Bangle.js 2. 0.04: Layout now compatible with Bangle.js 2.
0.05: Use weather condition code for icon selection. 0.05: Use weather condition code for icon selection.
0.06: Dev9-New settings to hide the weather icon, day of week, date and/or wind speed. 0.06: Dev9-New settings to optionally hide elements. Images placed into functions for performance.

View File

@ -1,6 +1,8 @@
# Weather Clock # Weather Clock
A clock which displays the current weather conditions. Temperature, wind speed, and an icon indicating the weather conditions are displayed. A clock which displays the current weather conditions. Time, day of week, date, temperature, wind speed, and an icon indicating the weather conditions are displayed.
As of Weather Clock v0.06 the day of week, date, temperature and/or wind speed can be hidden using settings.
Standard widgets are displayed. Standard widgets are displayed.

View File

@ -139,7 +139,7 @@ function draw() {
} }
function loadSettings() { function loadSettings() {
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{}; settings = storage.readJSON(SETTINGS_FILE,1)||{};
settings.icon = (settings.icon === undefined ? true : settings.icon); settings.icon = (settings.icon === undefined ? true : settings.icon);
settings.day = (settings.day === undefined ? true : settings.day); settings.day = (settings.day === undefined ? true : settings.day);
settings.date = (settings.date === undefined ? true : settings.date); settings.date = (settings.date === undefined ? true : settings.date);

View File

@ -1,10 +1,10 @@
(function(back) { (function(back) {
const SETTINGS_FILE = "weatherClock.json"; const SETTINGS_FILE = "weatherClock.json";
// Load setings file // Load settings file
const storage = require('Storage') const storage = require('Storage');
let settings = storage.readJSON(SETTINGS_FILE, 1) || {} let settings = storage.readJSON(SETTINGS_FILE, 1) || {};
let s; let s = {};
s.icon = (settings.icon === undefined ? true : settings.icon); s.icon = (settings.icon === undefined ? true : settings.icon);
s.day = (settings.day === undefined ? true : settings.day); s.day = (settings.day === undefined ? true : settings.day);
s.date = (settings.date === undefined ? true : settings.date); s.date = (settings.date === undefined ? true : settings.date);
@ -46,5 +46,5 @@
save(); save();
}, },
} }
}) });
}) });