Please upload a hex file here. This file should be the .app_hex
+
+
The currently available Espruino firmware releases are:
+
+
+
To update, click the link and then click the 'Upload' button that appears.
+
+
+
Or you can upload a hex or zip file here. This file should be an .app_hex
file, *not* the normal .hex (as that contains the bootloader as well).
-
-
+
+
+
Firmware updates via this tool work differently to the NRF Connect method mentioned on
+ the Bangle.js page. Firmware
+ is uploaded to a file on the Bangle. Once complete the Bangle reboots and the bootloader copies
+ the new firmware into internal Storage.
+
+
+
From 61553056da20cd3e1f126d732cb9043bbb126b8b Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 15:56:37 +0000
Subject: [PATCH 80/94] app notes
---
apps.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps.json b/apps.json
index 6deee8fa4..5abbfb1f8 100644
--- a/apps.json
+++ b/apps.json
@@ -79,7 +79,7 @@
"name": "Android Integration",
"shortName": "Android",
"version": "0.04",
- "description": "(BETA) App to display notifications from Gadgetbridge on Android. This will eventually replace the Gadgetbridge widget.",
+ "description": "Display notifications/music/etc from Gadgetbridge on Android. This replaces the old Gadgetbridge widget.",
"icon": "app.png",
"tags": "tool,system,messages,notifications",
"dependencies": {"messages":"app"},
@@ -96,7 +96,7 @@
"id": "ios",
"name": "iOS Integration",
"version": "0.06",
- "description": "(BETA) App to display notifications from iOS devices",
+ "description": "Display notifications/music/etc from iOS devices",
"icon": "app.png",
"tags": "tool,system,ios,apple,messages,notifications",
"dependencies": {"messages":"app"},
@@ -283,7 +283,7 @@
"id": "gbridge",
"name": "Gadgetbridge",
"version": "0.24",
- "description": "The default notification handler for Gadgetbridge notifications from Android. This will eventually be replaced by the 'Android' app.",
+ "description": "(NOT RECOMMENDED) Handles Gadgetbridge notifications from Android. This is now replaced by the 'Android' app.",
"icon": "app.png",
"type": "widget",
"tags": "tool,system,android,widget",
From 52ed2c3b5d5bf447f6a21c252acf65ac5acb143e Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 15:56:58 +0000
Subject: [PATCH 81/94] 0.04: Fix widget hiding code (fix #1046)
---
apps.json | 6 +++---
apps/pebble/ChangeLog | 1 +
apps/pebble/pebble.app.js | 11 ++++++-----
apps/widviz/ChangeLog | 6 +++---
apps/widviz/widget.js | 11 ++++++++---
5 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/apps.json b/apps.json
index 5abbfb1f8..484ea6f7e 100644
--- a/apps.json
+++ b/apps.json
@@ -2642,12 +2642,12 @@
"id": "widviz",
"name": "Widget Visibility Widget",
"shortName": "Viz Widget",
- "version": "0.02",
+ "version": "0.03",
"description": "Swipe left to hide top bar widgets, swipe right to redisplay.",
"icon": "eye.png",
"type": "widget",
"tags": "widget",
- "supports": ["BANGLEJS"],
+ "supports": ["BANGLEJS","BANGLESJ2"],
"storage": [
{"name":"widviz.wid.js","url":"widget.js"}
]
@@ -4670,7 +4670,7 @@
"id": "pebble",
"name": "Pebble Clock",
"shortName": "Pebble",
- "version": "0.03",
+ "version": "0.04",
"description": "A pebble style clock to keep the rebellion going",
"readme": "README.md",
"icon": "pebble.png",
diff --git a/apps/pebble/ChangeLog b/apps/pebble/ChangeLog
index fc3ff3ba4..76f90de8b 100644
--- a/apps/pebble/ChangeLog
+++ b/apps/pebble/ChangeLog
@@ -1,3 +1,4 @@
0.01: first release
0.02: included deployment of pebble.settings.js in apps.json
0.03: Changed time+calendar font to LECO1976Regular, changed to slanting boot
+0.04: Fix widget hiding code (fix #1046)
diff --git a/apps/pebble/pebble.app.js b/apps/pebble/pebble.app.js
index ce9ab3340..106e09b82 100644
--- a/apps/pebble/pebble.app.js
+++ b/apps/pebble/pebble.app.js
@@ -34,7 +34,7 @@ function draw() {
// turn the warning on once we have dipped below 30%
if (E.getBattery() < 30)
batteryWarning = true;
-
+
// turn the warning off once we have dipped above 40%
if (E.getBattery() > 40)
batteryWarning = false;
@@ -57,7 +57,7 @@ function draw() {
g.setFontAlign(0, -1);
g.drawString(da[0].toUpperCase(), w/4, ha); // day of week
g.drawString(getSteps(), 3*w/4, ha);
-
+
// time
// white on red for battery warning
g.setColor(!batteryWarning ? g.theme.bg : '#f00');
@@ -71,7 +71,7 @@ function draw() {
// contrast bar
g.setColor(g.theme.fg);
g.fillRect(0, h3, w, h3 + t);
-
+
// the bottom
g.setColor(settings.bg);
g.fillRect(0, h3 + t, w, h);
@@ -111,9 +111,10 @@ g.clear();
Bangle.loadWidgets();
/*
* we are not drawing the widgets as we are taking over the whole screen
- * so we will blank out the draw() functions of each widget
+ * so we will blank out the draw() functions of each widget and change the
+ * area to the top bar doesn't get cleared.
*/
-for (let wd of WIDGETS) {wd.draw=()=>{};}
+for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
loadSettings();
setInterval(draw, 15000); // refresh every 15s
draw();
diff --git a/apps/widviz/ChangeLog b/apps/widviz/ChangeLog
index e1958b429..9785f4d84 100644
--- a/apps/widviz/ChangeLog
+++ b/apps/widviz/ChangeLog
@@ -1,3 +1,3 @@
- 0.01: New Widget
- 0.02: swipe left,right update
-
+0.01: New Widget
+0.02: swipe left,right update
+0.03: Fix widget visibility code to the top bar isn't cleared by drawWidgets
diff --git a/apps/widviz/widget.js b/apps/widviz/widget.js
index 241dabf61..1490cf11a 100644
--- a/apps/widviz/widget.js
+++ b/apps/widviz/widget.js
@@ -6,16 +6,21 @@
if (!Bangle.isLCDOn() || saved) return;
saved = [];
for (var wd of WIDGETS) {
- saved.push(wd.draw);
+ saved.push({d:wd.draw,a:wd.area});
wd.draw=()=>{};
+ wd.area="";
}
g.setColor(0,0,0);
- g.fillRect(0,0,239,23);
+ g.fillRect(0,0,g.getWidth(),23);
}
function reveal(){
if (!Bangle.isLCDOn() || !saved) return;
- for (var wd of WIDGETS) wd.draw = saved.shift();
+ for (var wd of WIDGETS) {
+ var o = saved.shift();
+ wd.draw = o.d;
+ wd.area = o.a;
+ }
Bangle.drawWidgets();
saved=null;
}
From f8e04ad28a348787d53e2f7aea1ee558dfab5081 Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 16:16:01 +0000
Subject: [PATCH 82/94] oops
---
apps.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps.json b/apps.json
index 4ffdfde9c..0e85f6e65 100644
--- a/apps.json
+++ b/apps.json
@@ -2660,7 +2660,7 @@
"icon": "eye.png",
"type": "widget",
"tags": "widget",
- "supports": ["BANGLEJS","BANGLESJ2"],
+ "supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widviz.wid.js","url":"widget.js"}
]
From 59b06d5aef7d9da0884161b55c26e285d2f25add Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 16:49:28 +0000
Subject: [PATCH 83/94] boot 0.38: Option to log to file if settings.log==2
settings 0.36: Added 'Utils' menu with helpful utilities for restoring
Bangle.js
---
apps.json | 4 +--
apps/boot/ChangeLog | 1 +
apps/boot/bootupdate.js | 15 +++++++--
apps/setting/ChangeLog | 1 +
apps/setting/README.md | 23 ++++++++++----
apps/setting/settings.js | 68 ++++++++++++++++++++++++++++++----------
6 files changed, 84 insertions(+), 28 deletions(-)
diff --git a/apps.json b/apps.json
index 0e85f6e65..50e14dec7 100644
--- a/apps.json
+++ b/apps.json
@@ -16,7 +16,7 @@
{
"id": "boot",
"name": "Bootloader",
- "version": "0.37",
+ "version": "0.38",
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
"icon": "bootloader.png",
"type": "bootloader",
@@ -146,7 +146,7 @@
{
"id": "setting",
"name": "Settings",
- "version": "0.35",
+ "version": "0.36",
"description": "A menu for setting up Bangle.js",
"icon": "settings.png",
"tags": "tool,system",
diff --git a/apps/boot/ChangeLog b/apps/boot/ChangeLog
index ffc2be495..b941a9937 100644
--- a/apps/boot/ChangeLog
+++ b/apps/boot/ChangeLog
@@ -41,3 +41,4 @@
Don't set beep vibration up on Bangle.js 2 (built in)
0.36: Add comments to .boot0 to make debugging a bit easier
0.37: Remove Quiet Mode settings: now handled by Quiet Mode Schedule app
+0.38: Option to log to file if settings.log==2
diff --git a/apps/boot/bootupdate.js b/apps/boot/bootupdate.js
index daf311fe6..3001bb5c1 100644
--- a/apps/boot/bootupdate.js
+++ b/apps/boot/bootupdate.js
@@ -23,8 +23,14 @@ if (s.ble!==false) {
boot += `bleServiceOptions.hid=Bangle.HID;\n`;
}
}
-if (s.blerepl===false) { // If not programmable, force terminal off Bluetooth
- if (s.log) boot += `Terminal.setConsole(true);\n`; // if showing debug, force REPL onto terminal
+if (s.log==2) { // logging to file
+ boot += `_DBGLOG=require("Storage").open("log.txt","a");
+`;
+} if (s.blerepl===false) { // If not programmable, force terminal off Bluetooth
+ if (s.log==2) boot += `_DBGLOG=require("Storage").open("log.txt","a");
+LoopbackB.on('data',function(d) {_DBGLOG.write(d);Terminal.write(d);});
+LoopbackA.setConsole(true);\n`;
+ else if (s.log) boot += `Terminal.setConsole(true);\n`; // if showing debug, force REPL onto terminal
else boot += `E.setConsole(null,{force:true});\n`; // on new (2v05+) firmware we have E.setConsole which allows a 'null' console
/* If not programmable add our own handler for Bluetooth data
to allow Gadgetbridge commands to be received*/
@@ -41,7 +47,10 @@ Bluetooth.on('line',function(l) {
try { global.GB(JSON.parse(l.slice(3,-1))); } catch(e) {}
});\n`;
} else {
- if (s.log) boot += `if (!NRF.getSecurityStatus().connected) Terminal.setConsole();\n`; // if showing debug, put REPL on terminal (until connection)
+ if (s.log==2) boot += `_DBGLOG=require("Storage").open("log.txt","a");
+LoopbackB.on('data',function(d) {_DBGLOG.write(d);Terminal.write(d);});
+if (!NRF.getSecurityStatus().connected) LoopbackA.setConsole();\n`;
+ else if (s.log) boot += `if (!NRF.getSecurityStatus().connected) Terminal.setConsole();\n`; // if showing debug, put REPL on terminal (until connection)
else boot += `Bluetooth.setConsole(true);\n`; // else if no debug, force REPL to Bluetooth
}
// we just reset, so BLE should be on.
diff --git a/apps/setting/ChangeLog b/apps/setting/ChangeLog
index b393dda00..c676e3828 100644
--- a/apps/setting/ChangeLog
+++ b/apps/setting/ChangeLog
@@ -38,3 +38,4 @@
0.33: Really fix 'beep' menu on Bangle.js 2 this time
0.34: Remove Quiet Mode LCD settings: now handled by Quiet Mode Schedule app
0.35: Change App/Widget settings to 'App Settings' so it fits on Bangle screen
+0.36: Added 'Utils' menu with helpful utilities for restoring Bangle.js
diff --git a/apps/setting/README.md b/apps/setting/README.md
index fb567030f..305c0b610 100644
--- a/apps/setting/README.md
+++ b/apps/setting/README.md
@@ -2,27 +2,26 @@
This is Bangle.js's settings menu
-* **Make Connectable** regardless of the current Bluetooth settings, makes Bangle.js so you can connect to it (while the window is up)
* **App/Widget Settings** settings specific to installed applications
* **BLE** Bluetooth Settings menu - see below.
-* **Debug Info** should debug info be shown on the watch's screen or not?
* **Beep** most Bangle.js do not have a speaker inside, but they can use the vibration motor to beep in different pitches. You can change the behaviour here to use a Piezo speaker if one is connected
* **Vibration** enable/disable the vibration motor
* **Quiet Mode** prevent notifications/alarms from vibrating/beeping/turning the screen on - see below
* **Locale** set time zone/whether the clock is 12/24 hour (for supported clocks)
* **Select Clock** if you have more than one clock face, select the default one
-* **HID** When Bluetooth is enabled, Bangle.js can appear as a Bluetooth Keyboard/Joystick/etc to send keypresses to a connected device.
- * **NOTE:** on some platforms enabling HID can cause you problems when trying to connect to Bangle.js to upload apps.
* **Set Time** Configure the current time - Note that this can be done much more easily by choosing 'Set Time' from the App Loader
* **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
-* **Reset Settings** Reset the settings to defaults
+* **Utils** Utilities - including resetting settings (see below)
* **Turn Off** Turn Bangle.js off
## BLE - Bluetooth Settings
+* **Make Connectable** regardless of the current Bluetooth settings, makes Bangle.js so you can connect to it (while the window is up)
* **BLE** is Bluetooth LE enabled and the watch connectable?
* **Programmable** if BLE is on, can the watch be connected to in order to program/upload apps? As long as your watch firmware is up to date, Gadgetbridge will work even with `Programmable` set to `Off`.
+* **HID** When Bluetooth is enabled, Bangle.js can appear as a Bluetooth Keyboard/Joystick/etc to send keypresses to a connected device.
+ * **NOTE:** on some platforms enabling HID can cause you problems when trying to connect to Bangle.js to upload apps.
* **Passkey BETA** allows you to set a passkey that is required to connect and pair to Bangle.js. **Note:** This is Beta and you will almost certainly encounter issues connecting with Web Bluetooth using this option.
* **Whitelist** allows you to specify only specific devices that you will let connect to your Bangle.js. Simply choose the menu item, then `Add Device`, and then connect to Bangle.js with the device you want to add. If you are already connected you will have to disconnect first. Changes will take effect when you exit the `Settings` app.
* **NOTE:** iOS devices and newer Android devices often implement Address Randomisation and change their Bluetooth address every so often. If you device's address changes, you will be unable to connect until you update the whitelist again.
@@ -44,4 +43,16 @@ The exact effects depend on the app. In general the watch will not wake up by i
- Off: Normal operation
- Alarms: Stops notifications, but "alarm" apps will still work
- Silent: Blocks even alarms
-
\ No newline at end of file
+
+## Utils
+
+
+* **Debug Info** should debug info be shown on the watch's screen or not?
+ * `Hide` (default) do not show debug information
+ * `Show` Show on the Bangle's screen (when not connected to Bluetooth or `Programmable:off`)
+ * `Log` Show on the Bangle's screen **and** write to a file called `log.txt` on Storage (when not connected to Bluetooth or `Programmable:off`). Warning - this file is appended to so may grow to be large if this is left enabled.
+* **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.
+* **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.
+* **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
diff --git a/apps/setting/settings.js b/apps/setting/settings.js
index e00c15462..8f95eb3bb 100644
--- a/apps/setting/settings.js
+++ b/apps/setting/settings.js
@@ -95,17 +95,8 @@ function showMainMenu() {
const mainmenu = {
'': { 'title': 'Settings' },
'< Back': ()=>load(),
- 'Make Connectable': ()=>makeConnectable(),
'App Settings': ()=>showAppSettingsMenu(),
'BLE': ()=>showBLEMenu(),
- 'Debug Info': {
- value: settings.log,
- format: v => v ? "Show" : "Hide",
- onchange: () => {
- settings.log = !settings.log;
- updateSettings();
- }
- },
'Beep': beepMenuItem,
'Vibration': {
value: settings.vibrate,
@@ -134,7 +125,7 @@ function showMainMenu() {
'Set Time': ()=>showSetTimeMenu(),
'LCD': ()=>showLCDMenu(),
'Theme': ()=>showThemeMenu(),
- 'Reset Settings': ()=>showResetMenu(),
+ 'Utils': ()=>showUtilMenu(),
'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() },
};
@@ -146,6 +137,7 @@ function showBLEMenu() {
var hidN = ["Off", "Kbrd & Media", "Kbrd","Joystick"];
E.showMenu({
'< Back': ()=>showMainMenu(),
+ 'Make Connectable': ()=>makeConnectable(),
'BLE': {
value: settings.ble,
format: boolFormat,
@@ -476,21 +468,63 @@ function showLocaleMenu() {
return E.showMenu(localemenu);
}
-function showResetMenu() {
- const resetmenu = {
- '': { 'title': 'Reset' },
+function showUtilMenu() {
+ var menu = {
+ '': { 'title': 'Utilities' },
'< Back': ()=>showMainMenu(),
+ 'Debug Info': {
+ value: E.clip(0|settings.log,0,2),
+ format: v => ["Hide","Show","Log"][E.clip(0|v,0,2)],
+ onchange: v => {
+ settings.log = v;
+ updateSettings();
+ }
+ },
+ 'Compact Storage': () => {
+ E.showMessage("Compacting...\nTakes approx\n1 minute",{title:"Storage"});
+ require("Storage").compact();
+ showUtilMenu();
+ },
+ 'Rewrite Settings': () => {
+ require("Storage").write(".boot0","eval(require('Storage').read('bootupdate.js'));");
+ load("setting.app.js");
+ },
+ 'Flatten Battery': () => {
+ E.showMessage('Flattening battery - this can take hours.\nLong-press button to cancel.');
+ Bangle.setLCDTimeout(0);
+ Bangle.setLCDPower(1);
+ if (Bangle.setGPSPower) Bangle.setGPSPower(1,"flat");
+ if (Bangle.setHRMPower) Bangle.setHRMPower(1,"flat");
+ if (Bangle.setCompassPower) Bangle.setCompassPower(1,"flat");
+ if (Bangle.setBarometerPower) Bangle.setBarometerPower(1,"flat");
+ if (Bangle.setHRMPower) Bangle.setGPSPower(1,"flat");
+ setInterval(function() {
+ var i=1000;while (i--);
+ }, 1);
+ },
'Reset Settings': () => {
- E.showPrompt('Reset Settings?').then((v) => {
+ E.showPrompt('Reset to Defaults?',{title:"Settings"}).then((v) => {
if (v) {
E.showMessage('Resetting');
resetSettings();
- }
- setTimeout(showMainMenu, 50);
+ setTimeout(showMainMenu, 50);
+ } else showUtilMenu();
});
}
};
- return E.showMenu(resetmenu);
+ if (Bangle.factoryReset) {
+ menu['Factory Reset'] = ()=>{
+ E.showPrompt('This will remove everything!',{title:"Factory Reset"}).then((v) => {
+ if (v) {
+ E.showMessage();
+ Terminal.setConsole();
+ Bangle.factoryReset();
+ } else showUtilMenu();
+ });
+ }
+ }
+
+ return E.showMenu(menu);
}
function makeConnectable() {
From 845a962005297ef51c05745cd721ea2a698945a7 Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 17:08:18 +0000
Subject: [PATCH 84/94] cliclocks - Load widgets after Bangle.setUI to ensure
widgets know if they're on a clock or not (fix #970)
---
apps.json | 4 ++--
apps/cliclockJS2Enhanced/ChangeLog | 1 +
apps/cliclockJS2Enhanced/app.js | 13 +++++++------
apps/cliock/ChangeLog | 1 +
apps/cliock/app.js | 8 ++++----
5 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/apps.json b/apps.json
index 50e14dec7..65dfa3188 100644
--- a/apps.json
+++ b/apps.json
@@ -1755,7 +1755,7 @@
"id": "cliock",
"name": "Commandline-Clock",
"shortName": "CLI-Clock",
- "version": "0.14",
+ "version": "0.15",
"description": "Simple CLI-Styled Clock",
"icon": "app.png",
"screenshots": [{"url":"screenshot_cli.png"}],
@@ -4422,7 +4422,7 @@
"id": "cliclockJS2Enhanced",
"name": "Commandline-Clock JS2 Enhanced",
"shortName": "CLI-Clock JS2",
- "version": "0.02",
+ "version": "0.03",
"description": "Simple CLI-Styled Clock with enhancements. Modes that are hard to use and unneded are removed (BPM, battery info, memory ect) credit to hughbarney for the original code and design. Also added HID media controlls, just swipe on the clock face to controll the media! Gadgetbride support coming soon(hopefully) Thanks to t0m1o1 for media controls!",
"icon": "app.png",
"screenshots": [{"url":"screengrab.png"}],
diff --git a/apps/cliclockJS2Enhanced/ChangeLog b/apps/cliclockJS2Enhanced/ChangeLog
index c7cb9e2c6..f4d146d5f 100644
--- a/apps/cliclockJS2Enhanced/ChangeLog
+++ b/apps/cliclockJS2Enhanced/ChangeLog
@@ -1,2 +1,3 @@
0.01: Submitted to App Loader
0.02: Removed unneded code, added HID controlls thanks to t0m1o1 for his code :p
+0.03: Load widgets after Bangle.setUI to ensure widgets know if they're on a clock or not (fix #970)
diff --git a/apps/cliclockJS2Enhanced/app.js b/apps/cliclockJS2Enhanced/app.js
index 70e86f3d6..b6172b497 100644
--- a/apps/cliclockJS2Enhanced/app.js
+++ b/apps/cliclockJS2Enhanced/app.js
@@ -50,7 +50,7 @@ if (next) {
setTimeout(drawApp, 1000);
Bangle.setLocked(true);
}, BTN1, { edge:"falling",repeat:true,debounce:50});
- Bangle.on('drag', function(e) {
+ Bangle.on('drag', function(e) {
if(!e.b){
console.log(lasty);
console.log(lastx);
@@ -91,7 +91,7 @@ if (next) {
lasty = lasty + e.dy;
}
});
-
+
}
@@ -144,14 +144,15 @@ function writeLine(str,line){
}
g.clear();
-Bangle.loadWidgets();
-Bangle.drawWidgets();
-drawAll();
+
Bangle.on('lcdPower',function(on) {
if (on) drawAll();
});
var click = setInterval(updateTime, 1000);
// Show launcher when button pressed
Bangle.setUI("clockupdown", btn=>{
- drawAll();
+ drawAll(); // why do we redraw here??
});
+Bangle.loadWidgets();
+Bangle.drawWidgets();
+drawAll();
diff --git a/apps/cliock/ChangeLog b/apps/cliock/ChangeLog
index 2a93a0d5f..68249b622 100644
--- a/apps/cliock/ChangeLog
+++ b/apps/cliock/ChangeLog
@@ -7,3 +7,4 @@
0.13: Use setUI, work with smaller screens and themes
0.14: Fix BTN1 (fix #853)
Add light/dark theme support
+0.15: Load widgets after Bangle.setUI to ensure widgets know if they're on a clock or not (fix #970)
diff --git a/apps/cliock/app.js b/apps/cliock/app.js
index 0fd6ea580..d9271bf15 100644
--- a/apps/cliock/app.js
+++ b/apps/cliock/app.js
@@ -183,9 +183,6 @@ Bangle.on('HRM', function(hrm) {
});
g.clear();
-Bangle.loadWidgets();
-Bangle.drawWidgets();
-drawAll();
Bangle.on('lcdPower',function(on) {
if (on) drawAll();
});
@@ -195,4 +192,7 @@ Bangle.setUI("clockupdown", btn=>{
if (btn<0) changeInfoMode();
if (btn>0) changeFunctionMode();
drawAll();
-});
\ No newline at end of file
+});
+Bangle.loadWidgets();
+Bangle.drawWidgets();
+drawAll();
From cc79881719061f2f8bbca6c2888ae76dcbfff9b6 Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 17:09:40 +0000
Subject: [PATCH 85/94] fix after #1018
---
apps.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps.json b/apps.json
index 62e317df1..cce0b3f36 100644
--- a/apps.json
+++ b/apps.json
@@ -2419,7 +2419,7 @@
{"name":"calendar.settings.js","url":"settings.js"},
{"name":"calendar.img","url":"calendar-icon.js","evaluate":true}
],
- "data": [{"name":"messages.json"}]
+ "data": [{"name":"calendar.json"}]
},
{
"id": "hidjoystick",
From a45f7506ffbbcb622ebf791605627eabce994888 Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Thu, 9 Dec 2021 17:16:55 +0000
Subject: [PATCH 86/94] more app.json fixes, remove warning about settings as
it seems nobody cares
---
apps.json | 4 ++--
bin/sanitycheck.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps.json b/apps.json
index cce0b3f36..1c37cfd56 100644
--- a/apps.json
+++ b/apps.json
@@ -4095,7 +4095,7 @@
{"name":"carcrazy.img","url":"app-icon.js","evaluate":true},
{"name":"carcrazy.settings.js","url":"settings.js"}
],
- "data": [{"name":"app.json"}]
+ "data": [{"name":"CarCrazy.csv"}]
},
{
"id": "shortcuts",
@@ -4537,7 +4537,7 @@
{"name":"schoolCalendar.img","url":"app-icon.js","evaluate":true}
],
"data": [
- {"name":"app.json"}
+ {"name":"calendarItems.csv"}
]
},
{ "id": "timecal",
diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js
index ea45dc19b..572364224 100755
--- a/bin/sanitycheck.js
+++ b/bin/sanitycheck.js
@@ -207,10 +207,10 @@ apps.forEach((app,appIdx) => {
}
});
// prefer "appid.json" over "appid.settings.json" (TODO: change to ERROR once all apps comply?)
- if (dataNames.includes(app.id+".settings.json") && !dataNames.includes(app.id+".json"))
+ /* if (dataNames.includes(app.id+".settings.json") && !dataNames.includes(app.id+".json"))
WARN(`App ${app.id} uses data file ${app.id+'.settings.json'} instead of ${app.id+'.json'}`)
else if (dataNames.includes(app.id+".settings.json"))
- WARN(`App ${app.id} uses data file ${app.id+'.settings.json'}`)
+ WARN(`App ${app.id} uses data file ${app.id+'.settings.json'}`)*/
// settings files should be listed under data, not storage (TODO: change to ERROR once all apps comply?)
if (fileNames.includes(app.id+".settings.json"))
WARN(`App ${app.id} uses storage file ${app.id+'.settings.json'} instead of data file`)
From 4ce0e39263c9ac07b641a4a285f46f17cae9a04f Mon Sep 17 00:00:00 2001
From: Richard de Boer
Date: Thu, 9 Dec 2021 20:17:11 +0100
Subject: [PATCH 87/94] gbmusic: Fix scrolling title background color
---
apps.json | 2 +-
apps/gbmusic/ChangeLog | 1 +
apps/gbmusic/app.js | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/apps.json b/apps.json
index 1c37cfd56..50a731430 100644
--- a/apps.json
+++ b/apps.json
@@ -3795,7 +3795,7 @@
"id": "gbmusic",
"name": "Gadgetbridge Music Controls",
"shortName": "Music Controls",
- "version": "0.07",
+ "version": "0.08",
"description": "Control the music on your Gadgetbridge-connected phone",
"icon": "icon.png",
"screenshots": [{"url":"screenshot_v1.png"},{"url":"screenshot_v2.png"}],
diff --git a/apps/gbmusic/ChangeLog b/apps/gbmusic/ChangeLog
index 9cebf0a31..316b98a84 100644
--- a/apps/gbmusic/ChangeLog
+++ b/apps/gbmusic/ChangeLog
@@ -5,3 +5,4 @@
0.05: Setting to disable double/triple press control, remove touch controls setting, reduce fadeout flicker
0.06: Bangle.js 2 support
0.07: Fix "previous" button image
+0.08: Fix scrolling title background color
diff --git a/apps/gbmusic/app.js b/apps/gbmusic/app.js
index f514dfccd..1bddf70f7 100644
--- a/apps/gbmusic/app.js
+++ b/apps/gbmusic/app.js
@@ -91,7 +91,7 @@ function rScroller(l) {
y = l.y+l.h/2;
l.offset = l.offset%w;
g.setClipRect(l.x, l.y, l.x+l.w-1, l.y+l.h-1)
- .setColor(l.col)
+ .setColor(l.col).setBgColor(l.bgCol) // need to set colors: iScroll calls this function outside Layout
.setFontAlign(-1, 0) // left center
.clearRect(l.x, l.y, l.x+l.w-1, l.y+l.h-1)
.drawString(l.label, l.x-l.offset+40, y)
From c9ffee04a74ac44896be2bc8baaa21c11122725f Mon Sep 17 00:00:00 2001
From: Richard de Boer
Date: Thu, 9 Dec 2021 20:54:39 +0100
Subject: [PATCH 88/94] messages: Open app when touching the widget
---
apps.json | 2 +-
apps/messages/ChangeLog | 3 ++-
apps/messages/widget.js | 6 ++++++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/apps.json b/apps.json
index 1c37cfd56..e7df56c13 100644
--- a/apps.json
+++ b/apps.json
@@ -57,7 +57,7 @@
{
"id": "messages",
"name": "Messages",
- "version": "0.10",
+ "version": "0.11",
"description": "App to display notifications from iOS and Gadgetbridge",
"icon": "app.png",
"type": "app",
diff --git a/apps/messages/ChangeLog b/apps/messages/ChangeLog
index 269a2cf62..a3a4f377c 100644
--- a/apps/messages/ChangeLog
+++ b/apps/messages/ChangeLog
@@ -12,4 +12,5 @@
buzz on new message (fix #999)
0.09: Message now disappears after 60s if no action taken and clock loads (fix 922)
Fix phone icon (#1014)
-0.10: Respect the 'new' attribute if it was set from iOS integrations
\ No newline at end of file
+0.10: Respect the 'new' attribute if it was set from iOS integrations
+0.11: Open app when touching the widget (Bangle.js 2 only)
\ No newline at end of file
diff --git a/apps/messages/widget.js b/apps/messages/widget.js
index 245a303fc..6403c6b8d 100644
--- a/apps/messages/widget.js
+++ b/apps/messages/widget.js
@@ -1,4 +1,5 @@
WIDGETS["messages"]={area:"tl",width:0,draw:function() {
+ Bangle.removeListener('touch', this.touch);
if (!this.width) return;
var c = (Date.now()-this.t)/1000;
g.reset().setBgColor((c&1) ? "#0f0" : "#030").setColor((c&1) ? "#000" : "#fff");
@@ -12,6 +13,7 @@ WIDGETS["messages"]={area:"tl",width:0,draw:function() {
WIDGETS["messages"].buzz(); // buzz every 4 seconds
}
setTimeout(()=>WIDGETS["messages"].draw(), 1000);
+ if (process.env.HWVERSION>1) Bangle.on('touch', this.touch);
},show:function(quiet) {
WIDGETS["messages"].t=Date.now(); // first time
WIDGETS["messages"].l=Date.now()-10000; // last buzz
@@ -33,6 +35,10 @@ WIDGETS["messages"]={area:"tl",width:0,draw:function() {
if (c=="-") Bangle.buzz(500).then(()=>setTimeout(b,100));
}
b();
+},touch:function(b,c) {
+ var w=WIDGETS["messages"];
+ if (!w||!w.width||c.xw.x+w.width||c.yw.y+23) return;
+ load("messages.app.js");
}};
/* We might have returned here if we were in the Messages app for a
message but then the watch was never viewed. In that case we don't
From f8628dd26d587edff90037bcd255aacbdddaafcc Mon Sep 17 00:00:00 2001
From: Marco H
Date: Fri, 10 Dec 2021 08:58:44 +0100
Subject: [PATCH 89/94] Update app.js
Load steps from Health Tracking app (if installed)
---
apps/clicompleteclk/app.js | 45 +++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 18 deletions(-)
diff --git a/apps/clicompleteclk/app.js b/apps/clicompleteclk/app.js
index 89dbce919..77dc22db6 100644
--- a/apps/clicompleteclk/app.js
+++ b/apps/clicompleteclk/app.js
@@ -68,7 +68,7 @@ function drawInfo(now) {
*/
// weather
- var weatherJson = getWeather();
+ const weatherJson = getWeather();
if(weatherJson && weatherJson.weather){
const currentWeather = weatherJson.weather;
@@ -84,9 +84,9 @@ function drawInfo(now) {
}
// steps
- if (stepsWidget() != undefined) {
+ const steps = getSteps();
+ if (steps != undefined) {
writeLineTopic("STEP", i);
- const steps = stepsWidget().getSteps();
writeLine(steps, i);
i++;
}
@@ -128,6 +128,30 @@ function writeLine(str,line,pColor){
g.drawString(str,marginLeftData,y);
}
+
+function getSteps() {
+ var steps = 0;
+ let health;
+ try {
+ health = require("health");
+ } catch (e) {
+ // Module health not found
+ }
+ if (health != undefined) {
+ health.readDay(new Date(), h=>steps+=h.steps);
+ } else if (WIDGETS.wpedom !== undefined) {
+ return WIDGETS.wpedom.getSteps();
+ } else if (WIDGETS.activepedom !== undefined) {
+ return WIDGETS.activepedom.getSteps();
+ }
+ return steps;
+}
+
+function getWeather() {
+ let jsonWeather = storage.readJSON('weather.json');
+ return jsonWeather;
+}
+
// EVENTS:
// turn on HRM when the LCD is unlocked
@@ -166,21 +190,6 @@ Bangle.on('HRM', function(hrm) {
//}
});
-
-function stepsWidget() {
- if (WIDGETS.activepedom !== undefined) {
- return WIDGETS.activepedom;
- } else if (WIDGETS.wpedom !== undefined) {
- return WIDGETS.wpedom;
- }
- return undefined;
-}
-
-function getWeather() {
- let jsonWeather = storage.readJSON('weather.json');
- return jsonWeather;
-}
-
g.clear();
Bangle.setUI("clock");
Bangle.loadWidgets();
From 87acbe83e59c2d3f1034e09a8467a3fd12e06348 Mon Sep 17 00:00:00 2001
From: Marco H
Date: Fri, 10 Dec 2021 08:58:52 +0100
Subject: [PATCH 90/94] Update README.md
---
apps/clicompleteclk/README.md | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/apps/clicompleteclk/README.md b/apps/clicompleteclk/README.md
index e182b55fd..62fdbbc61 100644
--- a/apps/clicompleteclk/README.md
+++ b/apps/clicompleteclk/README.md
@@ -6,9 +6,8 @@ It can show the following (depending on availability) information:
* Time
* Day of week
* Date
-* Weather condition (requires weather app)
-* Temperature (requires weather app)
-* Steps (requires a step widget)
+* Weather conditions and temperature (requires app [Weather](https://banglejs.com/apps/#weather))
+* Steps (requires app [Health Tracking](https://banglejs.com/apps/#health%20tracking) or a step widget)
* Heart rate (when screen is on and unlocked)
## TODO
From 24b5937295fc8f84288b3932656a2db187812cf3 Mon Sep 17 00:00:00 2001
From: Marco H
Date: Fri, 10 Dec 2021 09:09:21 +0100
Subject: [PATCH 91/94] ChangeLog: v.0.02
---
apps/clicompleteclk/ChangeLog | 1 +
1 file changed, 1 insertion(+)
diff --git a/apps/clicompleteclk/ChangeLog b/apps/clicompleteclk/ChangeLog
index 85b5360ad..ee05bd582 100644
--- a/apps/clicompleteclk/ChangeLog
+++ b/apps/clicompleteclk/ChangeLog
@@ -1 +1,2 @@
0.01: New clock!
+0.02: Load steps from Health Tracking app (if installed)
From f3531c81602ab35e5f15d16f4919d56dbfd2e4c9 Mon Sep 17 00:00:00 2001
From: Marco H
Date: Fri, 10 Dec 2021 09:27:10 +0100
Subject: [PATCH 92/94] Update apps.json
---
apps.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps.json b/apps.json
index 1c37cfd56..1c8efd59b 100644
--- a/apps.json
+++ b/apps.json
@@ -4845,7 +4845,7 @@
{ "id": "clicompleteclk",
"name": "CLI complete clock",
"shortName":"CLI cmplt clock",
- "version":"0.01",
+ "version":"0.02",
"description": "Command line styled clock with lots of information",
"icon": "app.png",
"allow_emulator": true,
From 25543abb11401c11bbb982bc38adc87cef9690ee Mon Sep 17 00:00:00 2001
From: Marco H
Date: Fri, 10 Dec 2021 11:39:16 +0100
Subject: [PATCH 93/94] Update app.js
Do not overwrite old heart rate value with '...'
---
apps/clicompleteclk/app.js | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/apps/clicompleteclk/app.js b/apps/clicompleteclk/app.js
index 77dc22db6..7fbdabcc1 100644
--- a/apps/clicompleteclk/app.js
+++ b/apps/clicompleteclk/app.js
@@ -103,8 +103,6 @@ function drawHeartRate(i) {
writeLine(hrtValue,i);
else
writeLine(hrtValue,i, topicColor);
- } else {
- writeLine("...",i);
}
lastHeartRateRowIndex = i;
}
@@ -162,11 +160,11 @@ Bangle.on('lock', function(isLocked) {
hrtValue = "...";
else
hrtValueIsOld = true;
- drawHeartRate();
} else {
hrtValueIsOld = true;
Bangle.setHRMPower(0,"clicompleteclk");
}
+ drawHeartRate();
});
Bangle.on('lcdPower',function(on) {
From 6b2f8e98d3a36c392b901e673763f5daeeea59a3 Mon Sep 17 00:00:00 2001
From: Gordon Williams
Date: Fri, 10 Dec 2021 20:09:14 +0000
Subject: [PATCH 94/94] oops - fix firmware loader issues
---
apps/fwupdate/custom.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apps/fwupdate/custom.html b/apps/fwupdate/custom.html
index 4ee99479b..b5c79a325 100644
--- a/apps/fwupdate/custom.html
+++ b/apps/fwupdate/custom.html
@@ -85,7 +85,7 @@ function checkForFileOnServer() {
});
}
- var regex = new RegExp("_banglejs2");
+ var regex = new RegExp("_banglejs2.*zip$");
var domFirmwareList = document.getElementById("latest-firmware-list");
var domFirmware = document.getElementById("latest-firmware");
@@ -107,7 +107,7 @@ function checkForFileOnServer() {
});
console.log("Finished check for firmware files...");
var fwlinks = document.querySelectorAll(".fw-link");
- for (var i=0;i {
e.preventDefault();
var url = e.target.href;