From c3f11f90d5ff5acab328b1a88214b1ad2a94c756 Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Thu, 2 Feb 2023 18:39:08 +0100 Subject: [PATCH 01/11] sched: add interface.html - Edit or delete existing events, add new - Add events from iCalendar file --- apps/sched/interface.html | 223 ++++++++++++++++++++++++++++++++++++++ apps/sched/metadata.json | 1 + 2 files changed, 224 insertions(+) create mode 100644 apps/sched/interface.html diff --git a/apps/sched/interface.html b/apps/sched/interface.html new file mode 100644 index 000000000..366e597a2 --- /dev/null +++ b/apps/sched/interface.html @@ -0,0 +1,223 @@ + + + + + + + + + +

Manage dated events

+ +
+ +
+ + + + + + + + + + + +
DateSummary
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ + + + + diff --git a/apps/sched/metadata.json b/apps/sched/metadata.json index 2a1b0f8ca..42c3aaa12 100644 --- a/apps/sched/metadata.json +++ b/apps/sched/metadata.json @@ -10,6 +10,7 @@ "provides_modules" : ["sched"], "default" : true, "readme": "README.md", + "interface": "interface.html", "storage": [ {"name":"sched.boot.js","url":"boot.js"}, {"name":"sched.js","url":"sched.js"}, From 6b5fee29aff57101bc8ba8997d2274c3ed62d42c Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 2 Feb 2023 21:40:34 +0100 Subject: [PATCH 02/11] back button for settings main menu --- apps/powermanager/ChangeLog | 1 + apps/powermanager/metadata.json | 2 +- apps/powermanager/settings.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/powermanager/ChangeLog b/apps/powermanager/ChangeLog index a83e8c676..06f38d399 100644 --- a/apps/powermanager/ChangeLog +++ b/apps/powermanager/ChangeLog @@ -3,3 +3,4 @@ 0.03: Use default Bangle formatter for booleans 0.04: Remove calibration with current voltage (Calibrate->Auto) as it is now handled by settings app Allow automatic calibration on every charge longer than 3 hours +0.05: Add back button to settings menu. diff --git a/apps/powermanager/metadata.json b/apps/powermanager/metadata.json index 0777feee3..456831aa9 100644 --- a/apps/powermanager/metadata.json +++ b/apps/powermanager/metadata.json @@ -2,7 +2,7 @@ "id": "powermanager", "name": "Power Manager", "shortName": "Power Manager", - "version": "0.04", + "version": "0.05", "description": "Allow configuration of warnings and thresholds for battery charging and display.", "icon": "app.png", "type": "bootloader", diff --git a/apps/powermanager/settings.js b/apps/powermanager/settings.js index 9eeb29e00..fe4719275 100644 --- a/apps/powermanager/settings.js +++ b/apps/powermanager/settings.js @@ -23,6 +23,7 @@ '': { 'title': 'Power Manager' }, + "< Back" : back, 'Monotonic percentage': { value: !!settings.forceMonoPercentage, onchange: v => { From f050b75e5b4892fbbac23cf836a2c04e0ea6c12d Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Fri, 3 Feb 2023 07:45:22 +0100 Subject: [PATCH 03/11] widalarmeta: fix #2542 Fix check for active alarm, either remove brackets or add return for filter in map --- apps/widalarmeta/ChangeLog | 1 + apps/widalarmeta/metadata.json | 2 +- apps/widalarmeta/widget.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/widalarmeta/ChangeLog b/apps/widalarmeta/ChangeLog index 8bdf1156f..1012ee386 100644 --- a/apps/widalarmeta/ChangeLog +++ b/apps/widalarmeta/ChangeLog @@ -4,3 +4,4 @@ Add option to show seconds 0.03: Fix Bell not appearing on alarms > 24h and redrawing interval Update to match the default alarm widget, and not show itself when an alarm is hidden. +0.04: Fix check for active alarm diff --git a/apps/widalarmeta/metadata.json b/apps/widalarmeta/metadata.json index 89e35c090..aad3c4321 100644 --- a/apps/widalarmeta/metadata.json +++ b/apps/widalarmeta/metadata.json @@ -2,7 +2,7 @@ "id": "widalarmeta", "name": "Alarm & Timer ETA", "shortName": "Alarm ETA", - "version": "0.03", + "version": "0.04", "description": "A widget that displays the time to the next Alarm or Timer in hours and minutes, maximum 24h (configurable).", "icon": "widget.png", "type": "widget", diff --git a/apps/widalarmeta/widget.js b/apps/widalarmeta/widget.js index 8615aa1d2..3ad2e6ad2 100644 --- a/apps/widalarmeta/widget.js +++ b/apps/widalarmeta/widget.js @@ -9,10 +9,10 @@ function draw() { const times = alarms - .map(alarm => { + .map(alarm => alarm.hidden !== true && require("sched").getTimeToAlarm(alarm) - }) + ) .filter(a => a !== undefined); const next = times.length > 0 ? Math.min.apply(null, times) : 0; let calcWidth = 0; From aa91d43fa9a37e97653355c2880b308d93c4fa38 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Fri, 3 Feb 2023 12:49:54 +0100 Subject: [PATCH 04/11] qcenter - Cleanup timeout --- apps/qcenter/ChangeLog | 1 + apps/qcenter/app.js | 1 + apps/qcenter/metadata.json | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/qcenter/ChangeLog b/apps/qcenter/ChangeLog index 366b0ff86..436949dc9 100644 --- a/apps/qcenter/ChangeLog +++ b/apps/qcenter/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App! 0.02: Fix fast loading on swipe to clock 0.03: Adds a setting for going back to clock on a timeout +0.04: Fix timeouts closing fast loaded apps \ No newline at end of file diff --git a/apps/qcenter/app.js b/apps/qcenter/app.js index f012fdda8..bd22c87e1 100644 --- a/apps/qcenter/app.js +++ b/apps/qcenter/app.js @@ -111,6 +111,7 @@ let layout = new Layout({ remove: ()=>{ Bangle.removeListener("swipe", onSwipe); Bangle.removeListener("touch", updateTimeout); + if (timeout) clearTimeout(timeout); delete Graphics.prototype.setFont8x12; } }); diff --git a/apps/qcenter/metadata.json b/apps/qcenter/metadata.json index 630fd2bef..cd3e350a4 100644 --- a/apps/qcenter/metadata.json +++ b/apps/qcenter/metadata.json @@ -2,7 +2,7 @@ "id": "qcenter", "name": "Quick Center", "shortName": "QCenter", - "version": "0.03", + "version": "0.04", "description": "An app for quickly launching your favourite apps, inspired by the control centres of other watches.", "icon": "app.png", "tags": "", From f4f07806a66cbd48d65857786de9944967f18161 Mon Sep 17 00:00:00 2001 From: Sam Sorensen <825813+sabrsorensen@users.noreply.github.com> Date: Sun, 5 Feb 2023 19:14:35 -0700 Subject: [PATCH 05/11] Added mtnclock support for reading weather.json This allows the use of owmweather or weather to provide weather updates to mtnclock. --- apps/mtnclock/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/mtnclock/app.js b/apps/mtnclock/app.js index 28ba25882..dedf60cfd 100644 --- a/apps/mtnclock/app.js +++ b/apps/mtnclock/app.js @@ -323,6 +323,11 @@ function setWeather() { draw(a); } +function readWeather() { + data = require("Storage").readJSON('weather.json').weather; + require("Storage").write('mtnclock.json', data); +} + const _GB = global.GB; global.GB = (event) => { if (event.t==="weather") { @@ -340,6 +345,7 @@ function queueDraw() { if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = setTimeout(function() { drawTimeout = undefined; + readWeather(); setWeather(); queueDraw(); }, 60000 - (Date.now() % 60000)); From 5c3b742a4275361656b734cda6037e2d68a4be25 Mon Sep 17 00:00:00 2001 From: Sam Sorensen <825813+sabrsorensen@users.noreply.github.com> Date: Sun, 5 Feb 2023 20:18:37 -0700 Subject: [PATCH 06/11] Prevent exceptions if weather.json doesn't exist. --- apps/mtnclock/app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/mtnclock/app.js b/apps/mtnclock/app.js index dedf60cfd..82d06e03b 100644 --- a/apps/mtnclock/app.js +++ b/apps/mtnclock/app.js @@ -324,8 +324,13 @@ function setWeather() { } function readWeather() { - data = require("Storage").readJSON('weather.json').weather; - require("Storage").write('mtnclock.json', data); + var weatherData = require("Storage").readJSON('weather.json', true); + if (weatherData !== undefined) { + if (weatherData.weather.time > data.time) { + data = weatherData.weather; + require("Storage").write('mtnclock.json', data); + } + } } const _GB = global.GB; From 3371f86bb5b8335d4d312ce7ca1d8ce967fc818b Mon Sep 17 00:00:00 2001 From: Sam Sorensen <825813+sabrsorensen@users.noreply.github.com> Date: Sun, 5 Feb 2023 21:39:43 -0700 Subject: [PATCH 07/11] Save minimal weather data and limit weather update frequency --- apps/mtnclock/app.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/mtnclock/app.js b/apps/mtnclock/app.js index 82d06e03b..996fe2cee 100644 --- a/apps/mtnclock/app.js +++ b/apps/mtnclock/app.js @@ -324,19 +324,26 @@ function setWeather() { } function readWeather() { - var weatherData = require("Storage").readJSON('weather.json', true); - if (weatherData !== undefined) { - if (weatherData.weather.time > data.time) { - data = weatherData.weather; - require("Storage").write('mtnclock.json', data); - } + var weatherJson = require("Storage").readJSON('weather.json', 1); + // save updated weather data if available and it has been an hour since last updated + if (weatherJson !== undefined && (data.time === undefined || (data.time + 3600000) < weatherJson.weather.time)) { + data = { + time: weatherJson.weather.time, + temp: weatherJson.weather.temp, + code: weatherJson.weather.code + }; + require("Storage").writeJSON('mtnclock.json', data); } } const _GB = global.GB; global.GB = (event) => { if (event.t==="weather") { - data = event; + data = { + temp: event.temp, + code: event.code, + time: Date.now() + }; require("Storage").write('mtnclock.json', event); setWeather(); } @@ -357,5 +364,6 @@ function queueDraw() { } queueDraw(); +readWeather(); setWeather(); Bangle.setUI("clock"); From 653756c9172976d10a8098e780db694c1a231f49 Mon Sep 17 00:00:00 2001 From: Sam Sorensen <825813+sabrsorensen@users.noreply.github.com> Date: Sun, 5 Feb 2023 21:48:53 -0700 Subject: [PATCH 08/11] Updated version and README --- apps/mtnclock/README.md | 2 +- apps/mtnclock/metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/mtnclock/README.md b/apps/mtnclock/README.md index 58538509d..066230d4e 100644 --- a/apps/mtnclock/README.md +++ b/apps/mtnclock/README.md @@ -4,7 +4,7 @@ Based on the Pebble watchface Weather Land. Mountain Pass Clock changes depending on time (day/night) and weather conditions. -This clock requires Gadgetbridge and an app that Gadgetbridge can use to get the current weather from OpenWeatherMap (e.g. Weather Notification). To set up Gadgetbridge and weather, see https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Weather. +This clock requires Gadgetbridge and an app that Gadgetbridge can use to get the current weather from OpenWeatherMap (e.g. Weather Notification), or a Bangle app that will update weather.kson such as OWM Weather. To set up Gadgetbridge and weather, see https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Weather. The scene will change according to the following OpenWeatherMap conditions: clear, cloudy, overcast, lightning, drizzle, rain, fog and snow. Each weather condition has night/day scenes. diff --git a/apps/mtnclock/metadata.json b/apps/mtnclock/metadata.json index a3a173069..82a0cccab 100644 --- a/apps/mtnclock/metadata.json +++ b/apps/mtnclock/metadata.json @@ -2,7 +2,7 @@ "id": "mtnclock", "name": "Mountain Pass Clock", "shortName": "Mtn Clock", - "version": "0.01", + "version": "0.02", "description": "A clock that changes scenery based on time and weather.", "readme":"README.md", "icon": "app.png", From 959e376f099fce0dedca47b43ff97c970c2f5637 Mon Sep 17 00:00:00 2001 From: Sam Sorensen <825813+sabrsorensen@users.noreply.github.com> Date: Sun, 5 Feb 2023 21:57:52 -0700 Subject: [PATCH 09/11] Fixed typo --- apps/mtnclock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mtnclock/README.md b/apps/mtnclock/README.md index 066230d4e..441754b83 100644 --- a/apps/mtnclock/README.md +++ b/apps/mtnclock/README.md @@ -4,7 +4,7 @@ Based on the Pebble watchface Weather Land. Mountain Pass Clock changes depending on time (day/night) and weather conditions. -This clock requires Gadgetbridge and an app that Gadgetbridge can use to get the current weather from OpenWeatherMap (e.g. Weather Notification), or a Bangle app that will update weather.kson such as OWM Weather. To set up Gadgetbridge and weather, see https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Weather. +This clock requires Gadgetbridge and an app that Gadgetbridge can use to get the current weather from OpenWeatherMap (e.g. Weather Notification), or a Bangle app that will update weather.json such as OWM Weather. To set up Gadgetbridge and weather, see https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Weather. The scene will change according to the following OpenWeatherMap conditions: clear, cloudy, overcast, lightning, drizzle, rain, fog and snow. Each weather condition has night/day scenes. From b2b299efc35e80ef23e07e22df62ed3e6abc38ee Mon Sep 17 00:00:00 2001 From: Sam Sorensen <825813+sabrsorensen@users.noreply.github.com> Date: Sun, 5 Feb 2023 21:59:29 -0700 Subject: [PATCH 10/11] Updated minimal weather data save from GB --- apps/mtnclock/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mtnclock/app.js b/apps/mtnclock/app.js index 996fe2cee..c6adc7706 100644 --- a/apps/mtnclock/app.js +++ b/apps/mtnclock/app.js @@ -344,7 +344,7 @@ global.GB = (event) => { code: event.code, time: Date.now() }; - require("Storage").write('mtnclock.json', event); + require("Storage").writeJSON('mtnclock.json', data); setWeather(); } if (_GB) setTimeout(_GB, 0, event); From d426ca3656591417fa82b07c6229d53c9770d843 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 6 Feb 2023 11:20:36 +0000 Subject: [PATCH 11/11] assistedgps 0.05: Fix regression in 0.04 that caused AGPS data not to get loaded --- apps/assistedgps/ChangeLog | 1 + apps/assistedgps/custom.html | 2 +- apps/assistedgps/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/assistedgps/ChangeLog b/apps/assistedgps/ChangeLog index ff2de6f67..92f04dc6d 100644 --- a/apps/assistedgps/ChangeLog +++ b/apps/assistedgps/ChangeLog @@ -2,3 +2,4 @@ 0.02: Update to work with Bangle.js 2 0.03: Select GNSS systems to use for Bangle.js 2 0.04: Now turns GPS off after upload +0.05: Fix regression in 0.04 that caused AGPS data not to get loaded diff --git a/apps/assistedgps/custom.html b/apps/assistedgps/custom.html index 75a4ecf32..716865983 100644 --- a/apps/assistedgps/custom.html +++ b/apps/assistedgps/custom.html @@ -158,7 +158,7 @@ var chunk = bin.substr(i,chunkSize); js += `\x10Serial1.write(atob("${btoa(chunk)}"))\n`; } - js = "\x10setTimeout(() => Bangle.setGPSPower(0,'agps'), 1000);\n"; // turn GPS off after a delay + js += "\x10setTimeout(() => Bangle.setGPSPower(0,'agps'), 1000);\n"; // turn GPS off after a delay return js; } diff --git a/apps/assistedgps/metadata.json b/apps/assistedgps/metadata.json index ac9fe5725..d2e7334c4 100644 --- a/apps/assistedgps/metadata.json +++ b/apps/assistedgps/metadata.json @@ -1,7 +1,7 @@ { "id": "assistedgps", "name": "Assisted GPS Updater (AGPS)", - "version": "0.04", + "version": "0.05", "description": "Downloads assisted GPS (AGPS) data to Bangle.js for faster GPS startup and more accurate fixes. **No app will be installed**, this just uploads new data to the GPS chip.", "sortorder": -1, "icon": "app.png",