From 7809129ddf1990f1c00a3d2aaf10a773f5e471d7 Mon Sep 17 00:00:00 2001 From: lunctis-viribus Date: Sun, 26 Feb 2023 16:59:43 +0100 Subject: [PATCH] weatherclock v0.06 --- apps/weatherClock/ChangeLog | 2 +- apps/weatherClock/README.md | 4 +++- apps/weatherClock/app.js | 2 +- apps/weatherClock/settings.js | 12 ++++++------ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/weatherClock/ChangeLog b/apps/weatherClock/ChangeLog index 37891568d..22f9fc5d2 100644 --- a/apps/weatherClock/ChangeLog +++ b/apps/weatherClock/ChangeLog @@ -3,4 +3,4 @@ 0.03: Minor layout extra spaces. 0.04: Layout now compatible with Bangle.js 2. 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. diff --git a/apps/weatherClock/README.md b/apps/weatherClock/README.md index f1f146440..c72a575ec 100644 --- a/apps/weatherClock/README.md +++ b/apps/weatherClock/README.md @@ -1,6 +1,8 @@ # 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. diff --git a/apps/weatherClock/app.js b/apps/weatherClock/app.js index 50649569c..8747620d8 100644 --- a/apps/weatherClock/app.js +++ b/apps/weatherClock/app.js @@ -139,7 +139,7 @@ function draw() { } function loadSettings() { - settings = require("Storage").readJSON(SETTINGS_FILE,1)||{}; + settings = storage.readJSON(SETTINGS_FILE,1)||{}; settings.icon = (settings.icon === undefined ? true : settings.icon); settings.day = (settings.day === undefined ? true : settings.day); settings.date = (settings.date === undefined ? true : settings.date); diff --git a/apps/weatherClock/settings.js b/apps/weatherClock/settings.js index f8925d86a..cd6a46970 100644 --- a/apps/weatherClock/settings.js +++ b/apps/weatherClock/settings.js @@ -1,10 +1,10 @@ (function(back) { const SETTINGS_FILE = "weatherClock.json"; - // Load setings file - const storage = require('Storage') - let settings = storage.readJSON(SETTINGS_FILE, 1) || {} - let s; + // Load settings file + const storage = require('Storage'); + let settings = storage.readJSON(SETTINGS_FILE, 1) || {}; + let s = {}; s.icon = (settings.icon === undefined ? true : settings.icon); s.day = (settings.day === undefined ? true : settings.day); s.date = (settings.date === undefined ? true : settings.date); @@ -46,5 +46,5 @@ save(); }, } - }) -}) + }); +});