From 02c4a1b9b70d5f650ea84e08a76025a295e4580d Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Fri, 22 Apr 2022 13:06:42 +0200 Subject: [PATCH 001/134] sleepphasealarm add logging, display with chart.js --- apps/sleepphasealarm/ChangeLog | 1 + apps/sleepphasealarm/app.js | 26 ++++++- apps/sleepphasealarm/interface.html | 103 ++++++++++++++++++++++++++++ apps/sleepphasealarm/metadata.json | 6 +- 4 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 apps/sleepphasealarm/interface.html diff --git a/apps/sleepphasealarm/ChangeLog b/apps/sleepphasealarm/ChangeLog index 875b3c1da..94ad5852e 100644 --- a/apps/sleepphasealarm/ChangeLog +++ b/apps/sleepphasealarm/ChangeLog @@ -3,3 +3,4 @@ 0.03: Add compatibility for Bangle.js 2 and new firmware, added "Alarm at " for the alarm time 0.04: Read alarms from new scheduling library, account for higher acceleration sensor noise on Bangle.js 2 0.05: Refactor decodeTime() to scheduling library +0.06: Add logging diff --git a/apps/sleepphasealarm/app.js b/apps/sleepphasealarm/app.js index 236b71c0b..0a8e83a08 100644 --- a/apps/sleepphasealarm/app.js +++ b/apps/sleepphasealarm/app.js @@ -1,6 +1,8 @@ const BANGLEJS2 = process.env.HWVERSION == 2; //# check for bangle 2 -const alarms = require("Storage").readJSON("sched.json",1)||[]; +const alarms = require("Storage").readJSON("sched.json",1) || []; +const config = require("Storage").readJSON("sleepphasealarm.json",1) || {logs: []}; const active = alarms.filter(a=>a.on); +let logs = []; // Sleep/Wake detection with Estimation of Stationary Sleep-segments (ESS): // Marko Borazio, Eugen Berlin, Nagihan Kücükyildiz, Philipp M. Scholl and Kristof Van Laerhoven, "Towards a Benchmark for Wearable Sleep Analysis with Inertial Wrist-worn Sensing Units", ICHI 2014, Verona, Italy, IEEE Press, 2014. @@ -108,12 +110,20 @@ function buzz() { }); } +function addLog(time, type) { + logs.push({time: time, type: type}); + require("Storage").writeJSON("sleepphasealarm.json", config); +} + // run var minAlarm = new Date(); var measure = true; if (nextAlarm !== undefined) { - Bangle.loadWidgets(); //# correct widget load draw order + config.logs[nextAlarm.getDate()] = []; // overwrite log on each day of month + logs = config.logs[nextAlarm.getDate()]; + Bangle.loadWidgets(); Bangle.drawWidgets(); + let swest_last; // minimum alert 30 minutes early minAlarm.setTime(nextAlarm.getTime() - (30*60*1000)); @@ -124,7 +134,16 @@ if (nextAlarm !== undefined) { if (swest !== undefined) { if (Bangle.isLCDOn()) { - drawString(swest ? "Sleep" : "Awake", BANGLEJS2 ? 150 : 180); //# remove x, adjust height + drawString(swest ? "Sleep" : "Awake", BANGLEJS2 ? 150 : 180); + } + // log + if (swest_last != swest) { + if (swest) { + addLog(new Date(Date.now() - sleepthresh*13/12.5*1000), "sleep"); // calculate begin of no motion phase, 13 values/second at 12.5Hz + } else { + addLog(new Date(), "awake"); + } + swest_last = swest; } } @@ -132,6 +151,7 @@ if (nextAlarm !== undefined) { // The alarm widget should handle this one setTimeout(load, 1000); } else if (measure && now >= minAlarm && swest === false) { + addLog(new Date(), "alarm"); buzz(); measure = false; } diff --git a/apps/sleepphasealarm/interface.html b/apps/sleepphasealarm/interface.html new file mode 100644 index 000000000..d9e5a2504 --- /dev/null +++ b/apps/sleepphasealarm/interface.html @@ -0,0 +1,103 @@ + + + + + + +

Please select a wakeup day:

+
+ +
+
+ +
+ + + + + + + diff --git a/apps/sleepphasealarm/metadata.json b/apps/sleepphasealarm/metadata.json index aecfa36e4..aba240e37 100644 --- a/apps/sleepphasealarm/metadata.json +++ b/apps/sleepphasealarm/metadata.json @@ -2,7 +2,7 @@ "id": "sleepphasealarm", "name": "SleepPhaseAlarm", "shortName": "SleepPhaseAlarm", - "version": "0.05", + "version": "0.06", "description": "Uses the accelerometer to estimate sleep and wake states with the principle of Estimation of Stationary Sleep-segments (ESS, see https://ubicomp.eti.uni-siegen.de/home/datasets/ichi14/index.html.en). This app will read the next alarm from the alarm application and will wake you up to 30 minutes early at the best guessed time when you are almost already awake.", "icon": "app.png", "tags": "alarm", @@ -11,5 +11,7 @@ "storage": [ {"name":"sleepphasealarm.app.js","url":"app.js"}, {"name":"sleepphasealarm.img","url":"app-icon.js","evaluate":true} - ] + ], + "data": [{"name":"sleepphasealarm.json","storageFile":true}], + "interface": "interface.html" } From 98f199105ef1442d5a75ea4f88cad8df78107e8a Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:24:43 -0700 Subject: [PATCH 002/134] Update boot.js --- apps/android/boot.js | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/apps/android/boot.js b/apps/android/boot.js index eb3d26c6e..a0d538a4a 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -4,7 +4,33 @@ Bluetooth.println(JSON.stringify(message)); } + function getCurrentTime() { + var time = new Date(); + return ( + time.getHours() * 3600000 + + time.getMinutes() * 60000 + + time.getSeconds() * 1000 + ); + } + + //convert GB DOW format to sched DOW format + function convDow(x) { + //if no DOW selected, set alarm to all DOW + if (x == 0) x = 127; + x = x.toString(2); + for (var i = 0; x.length < 7; i++) { + x = "0"+x; + } + x = x.slice(1, 7) + x.slice(0, 1); + return "0b"+x; + } + var settings = require("Storage").readJSON("android.settings.json",1)||{}; + //default alarm settings + if (settings.rp == undefined) settings.rp = true; + if (settings.as == undefined) settings.as = true; + if (settings.vibrate == undefined) settings.vibrate = ".."; + require('Storage').writeJSON("android.settings.json", settings); var _GB = global.GB; global.GB = (event) => { // feed a copy to other handlers if there were any @@ -44,6 +70,32 @@ title:event.name||"Call", body:"Incoming call\n"+event.number}); require("messages").pushMessage(event); }, + "alarm" : function() { + //wipe existing GB alarms + var gbalarms = require("sched").getAlarms().filter(a=>a.appid=="gbalarms"); + for (i = 0; i < gbalarms.length; i++) { + require("sched").setAlarm(gbalarms[i].id, undefined); + } + var alarms = require("sched").getAlarms(); + for (j = 0; j < event.d.length; j++) { + //prevents all alarms from going off at once?? + var last = (event.d[j].h * 3600000 + event.d[j].m * 60000 < getCurrentTime()) ? (new Date()).getDate() : 0; + var a = { + id : "gb"+j, + appid : "gbalarms", + on : true, + t : event.d[j].h * 3600000 + event.d[j].m * 60000, + dow : convDow(event.d[j].rep), + last : last, + rp : settings.rp, + as : settings.as, + vibrate : settings.vibrate + }; + alarms.push(a); + } + require("sched").setAlarms(alarms); + require("sched").reload(); + }, }; var h = HANDLERS[event.t]; if (h) h(); else console.log("GB Unknown",event); From 9df3354a49fcbe47d2591317b7ffbbaa07fea8df Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:25:03 -0700 Subject: [PATCH 003/134] Update settings.js --- apps/android/settings.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/apps/android/settings.js b/apps/android/settings.js index 7c46a1fc0..bfb1cd096 100644 --- a/apps/android/settings.js +++ b/apps/android/settings.js @@ -24,7 +24,28 @@ updateSettings(); } }, - /*LANG*/"Messages" : ()=>load("messages.app.js") + /*LANG*/"Messages" : ()=>load("messages.app.js"), + /*LANG*/"Alarms" : () => E.showMenu({ + "" : { "title" : "Find Phone" }, + "< Back" : ()=>E.showMenu(mainmenu), + /*LANG*/"Vibrate": require("buzz_menu").pattern(settings.vibrate, v => {settings.vibrate = v; updateSettings();}), + /*LANG*/"Repeat": { + value: settings.rp, + format : v=>v?/*LANG*/"Yes":/*LANG*/"No", + onchange: v => { + settings.rp = v; + updateSettings(); + } + }, + /*LANG*/"Auto snooze": { + value: settings.as, + format : v=>v?/*LANG*/"Yes":/*LANG*/"No", + onchange: v => { + settings.as = v; + updateSettings(); + } + }, + }) }; E.showMenu(mainmenu); }) From 6c5ab23c9db980f3c83f05d4e821fb63398ea87e Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:25:20 -0700 Subject: [PATCH 004/134] Update ChangeLog --- apps/android/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/android/ChangeLog b/apps/android/ChangeLog index 59cb23a46..96b50c3a0 100644 --- a/apps/android/ChangeLog +++ b/apps/android/ChangeLog @@ -6,3 +6,4 @@ 0.05: Fix handling of message actions 0.06: Option to keep messages after a disconnect (default false) (fix #1186) 0.07: Include charging state in battery updates to phone +0.08: Handling of alarms From bbd90e08698f4e6da5d38dc919b5b16b07223675 Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:25:39 -0700 Subject: [PATCH 005/134] Update metadata.json --- apps/android/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/android/metadata.json b/apps/android/metadata.json index d126b869a..203cd18b1 100644 --- a/apps/android/metadata.json +++ b/apps/android/metadata.json @@ -2,7 +2,7 @@ "id": "android", "name": "Android Integration", "shortName": "Android", - "version": "0.07", + "version": "0.08", "description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.", "icon": "app.png", "tags": "tool,system,messages,notifications,gadgetbridge", From d5489c7fef847ba2fb7bf34c6b9c27ade6303342 Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:26:39 -0700 Subject: [PATCH 006/134] Update README.md --- apps/android/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/android/README.md b/apps/android/README.md index c10718aac..580eeec9a 100644 --- a/apps/android/README.md +++ b/apps/android/README.md @@ -21,6 +21,7 @@ of Gadgetbridge - making your phone make noise so you can find it. * `Keep Msgs` - default is `Off`. When Gadgetbridge disconnects, should Bangle.js keep any messages it has received, or should it delete them? * `Messages` - launches the messages app, showing a list of messages +* `Alarms` - opens a submenu where you can set default settings for alarms such as vibration pattern, repeat, and auto snooze ## How it works From d41284222074ef7fcf4b86f838453d8ee3d32dad Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:46:21 -0700 Subject: [PATCH 007/134] Create lib.js --- apps/tapkb/lib.js | 168 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 apps/tapkb/lib.js diff --git a/apps/tapkb/lib.js b/apps/tapkb/lib.js new file mode 100644 index 000000000..24c52154f --- /dev/null +++ b/apps/tapkb/lib.js @@ -0,0 +1,168 @@ +exports.input = function(options) { + options = options||{}; + var text = options.text; + if ("string"!=typeof text) text=""; + +var layer = 0; +var caps = 0; + +class keyPad { + constructor(x1, y1, x2, y2, func) { + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + this.func = !func ? "" : func; + } + get funcName() { + this.func = func; + } + set funcName(a) { + this.func = a; + } + + draw() { + g.setColor(g.theme.fg).drawRect(this.x1, this.y1, this.x2, this.y2).clearRect(this.x1+1, this.y1+1, this.x2-1, this.y2-1).setFont("6x8",2).setFontAlign(0, 0, 0).drawString(this.func, (((this.x2-this.x1)/2)+this.x1), (((this.y2-this.y1)/2)+this.y1)); + } + + onTouch(xy) { + if (this.func == "space") text += " "; + else if (this.func == "<-") text = text.slice(0, -1); + else if (this.func == "new\nline") text += String.fromCharCode(182); + else if (this.func == "caps") { + caps = 1; + renderKeys(); + } + else if (this.func == "Caps") { + caps = 2; + renderKeys(); + } + else if (this.func == "CAPS") { + caps = 0; + renderKeys(); + } + else { + text += this.func; + if (caps == 1) caps = 0; + } + g.clearRect(25, 0, g.getWidth(), 25).setFontAlign(-1, -1).drawString(text.substring(text.length-12, text.length)+"_", 25, 7); + } +} + +function renderKeys() { + var a; + var i; + if (layer == 0) { + if (caps == 0) { + a = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "caps", "space", "<-"]; + } + else a = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "Caps", "space", "<-"]; + if (caps == 2) a[9] = "CAPS"; + for (i = 0; i < a.length; i++) { + pad[i].funcName = a[i]; + } + } + else if (layer == 1) { + if (caps == 0) { + a = ["j", "k", "l", "m", "n", "o", "p", "q", "r", "caps", "space", "<-"]; + } + else a = ["J", "K", "L", "M", "N", "O", "P", "Q", "R", "Caps", "space", "<-"]; + if (caps == 2) a[9] = "CAPS"; + for (i = 0; i < a.length; i++) { + pad[i].funcName = a[i]; + } + } + else if (layer == 2) { + if (caps == 0) { + a = ["s", "t", "u", "v", "w", "x", "y", "z", "0", "caps", "space", "<-"]; + } + else a = ["S", "T", "U", "V", "W", "X", "Y", "Z", "0", "Caps", "space", "<-"]; + if (caps == 2) a[9] = "CAPS"; + for (i = 0; i < a.length; i++) { + pad[i].funcName = a[i]; + } + } + else if (layer == 3) { + if (caps == 0) { + a = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "caps", "space", "<-"]; + } + else a = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "Caps", "space", "<-"]; + if (caps == 2) a[9] = "CAPS"; + for (i = 0; i < a.length; i++) { + pad[i].funcName = a[i]; + } + } + else if (layer == 4) { + if (caps == 0) { + a = [".", ",", "?", "!", "(", ")", "-", "\'", "new\nline", "caps", "space", "<-"]; + } + else a = ["-", "+", "/", "*", ":", "#", "$", "%", "new\nline", "Caps", "space", "<-"]; + if (caps == 2) a[9] = "CAPS"; + for (i = 0; i < a.length; i++) { + pad[i].funcName = a[i]; + } + } + + for (var j = 0; j < pad.length; j++) { + pad[j].draw(); + } +} + +var pad = []; +pad[0] = new keyPad(0, 29, 57, 64); +pad[1] = new keyPad(59, 29, 116, 64); +pad[2] = new keyPad(118, 29, 175, 64); +pad[3] = new keyPad(0, 66, 57, 101); +pad[4] = new keyPad(59, 66, 116, 101); +pad[5] = new keyPad(118, 66, 175, 101); +pad[6] = new keyPad(0, 103, 57, 138); +pad[7] = new keyPad(59, 103, 116, 138); +pad[8] = new keyPad(118, 103, 175, 138); +pad[9] = new keyPad(0, 140, 57, 175); +pad[10] = new keyPad(59, 140, 116, 175); +pad[11] = new keyPad(118, 140, 175, 175); +g.clear(); +renderKeys(); + +var drag; +var e; + +return new Promise((resolve,reject) => { + + Bangle.setUI({mode:"custom", drag:e=>{ + if (!drag) { // start dragging + drag = {x: e.x, y: e.y}; + } + else if (!e.b) { // released + const dx = e.x-drag.x, dy = e.y-drag.y; + drag = null; + //horizontal swipes + if (Math.abs(dx)>Math.abs(dy)+10) { + //swipe left + if (dx<0) layer == 4 ? layer = 0 : layer++; + //swipe right + if (dx>0) layer == 0 ? layer = 4 : layer--; + } + } + renderKeys(); + },touch:(button, xy)=>{ + for (var i = 0; i < pad.length; i++) { + if ((xy.x >= pad[i].x1) && (xy.x <= pad[i].x2) && (xy.y >= pad[i].y1) && (xy.y <= pad[i].y2)) { + pad[i].onTouch(xy); + i = pad.length; + } + } + },back:()=>{ + Bangle.setUI(); + g.clear(); + resolve(text.replace(new RegExp(String.fromCharCode(182), 'g'), '\n')); + }}); + g.clearRect(25, 0, g.getWidth(), 25).setColor(g.theme.fg).setFont("6x8", 2); + if (text == "") g.setFontAlign(0, -1).drawString("<-Swipe->", g.getWidth()/2, 7); + else { + text = text.replace(/\n/g, String.fromCharCode(182)); + g.setFontAlign(-1, -1).drawString(text.substring(text.length-12, text.length)+"_", 25, 7); + } +}); + +}; From 7a0d47b4d8ce83f467dcd8d21c26ee52f1d71c2a Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:46:44 -0700 Subject: [PATCH 008/134] Add files via upload --- apps/tapkb/ChangeLog | 1 + apps/tapkb/README.md | 4 ++++ apps/tapkb/app-icon.js | 1 + apps/tapkb/app.png | Bin 0 -> 678 bytes apps/tapkb/metadata.json | 15 +++++++++++++++ apps/tapkb/screenshot.png | Bin 0 -> 2589 bytes 6 files changed, 21 insertions(+) create mode 100644 apps/tapkb/ChangeLog create mode 100644 apps/tapkb/README.md create mode 100644 apps/tapkb/app-icon.js create mode 100644 apps/tapkb/app.png create mode 100644 apps/tapkb/metadata.json create mode 100644 apps/tapkb/screenshot.png diff --git a/apps/tapkb/ChangeLog b/apps/tapkb/ChangeLog new file mode 100644 index 000000000..624f1b0fb --- /dev/null +++ b/apps/tapkb/ChangeLog @@ -0,0 +1 @@ +0.01: Initial version \ No newline at end of file diff --git a/apps/tapkb/README.md b/apps/tapkb/README.md new file mode 100644 index 000000000..8fc7cece0 --- /dev/null +++ b/apps/tapkb/README.md @@ -0,0 +1,4 @@ +# Usage + +* Swipe left or right to cycle between the alphabet, numerals, and symbols. +* "New line" is represented by paragraph symbols (¶). When you hit the back button, these symbols will be converted into newline. \ No newline at end of file diff --git a/apps/tapkb/app-icon.js b/apps/tapkb/app-icon.js new file mode 100644 index 000000000..c2b495917 --- /dev/null +++ b/apps/tapkb/app-icon.js @@ -0,0 +1 @@ +atob("MDCBAf////////////////AAAAAAD8AAAAAAA4AAAAAAAYAAAAAAAQf/////4A//////8A//////8A//////8A//////8A//////8A///8P/8A///8P/8A///8P/8A///8P/8A///8P/8A///8P/8A///8P//w///8P//w///8MP/w///8MP/w///8MMPw///8MMPw///8AMMA///8AAMA///8AAAA///8AAAA///8OAAA///8P+AA//wcP/8Af/AEP/8IA+AAP/8IA+AAP/8MA+DAP/8PA+BgP/8P//B4P/8P//g8P/8P//wfP/8P//4Pv/8P//8H//8P//8D//8P//+D//8P///B//4P///gAAAf///wAAAf///4AAA////8AADw==") \ No newline at end of file diff --git a/apps/tapkb/app.png b/apps/tapkb/app.png new file mode 100644 index 0000000000000000000000000000000000000000..2b01ad28042e192524bee3c2cddf89ef958086bd GIT binary patch literal 678 zcmV;X0$KfuP)Dw!Y7&dt$lmS}_w#N8_rP$=?CkSC&&=%1 z&U=i|E*!&s^sv;j(!)I*%@RI=J1r2Ix7?02|HEn$A2)$8ZH6tTY?&s^`FQ0E?8lh) zU<^~3)vxs~%qJ?RhNCeT4(Qj~gM~z8n|eNpG5uN>I?+WOok6QAh(5jDVX3GKtKPu) z0An>WRagB8j0_ALBLl<6AXlNf(6@SxMxX{%+8;(E&>(V+%xDBEU>>hZJeM4q)H$;$ zBpP_FJ-j58QoitD;XvmHBb~?>Fo9r&c@mt#@iYL*J^;U?!QcsF6jR& zXcMm26u5Q+gw5wmg7_EaFrR+>;63Z#8gcVjDgrg8je=tSQMkiH8Z!CzX}1fJ4$> zsCAc_CJn%u2E{+e+NKQc;OdTmS$7 M07*qoM6N<$f}npf`2YX_ literal 0 HcmV?d00001 diff --git a/apps/tapkb/metadata.json b/apps/tapkb/metadata.json new file mode 100644 index 000000000..c450f3d47 --- /dev/null +++ b/apps/tapkb/metadata.json @@ -0,0 +1,15 @@ +{ + "id": "tapkb", + "name": "Tap keyboard", + "version":"0.01", + "description": "An onscreen tap keyboard.", + "icon": "app.png", + "type":"textinput", + "tags": "keyboard", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "screenshots": [{"url":"screenshot.png"}], + "storage": [ + {"name":"textinput","url":"lib.js"} + ] +} \ No newline at end of file diff --git a/apps/tapkb/screenshot.png b/apps/tapkb/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..bd1caed380d80e350f8ec523e85adebf0355864e GIT binary patch literal 2589 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 literal 0 HcmV?d00001 From 033a2a4f6e24cc81c4f36a29b5619f4250292c3b Mon Sep 17 00:00:00 2001 From: frigis1 <63980066+frigis1@users.noreply.github.com> Date: Sun, 24 Apr 2022 00:47:55 -0700 Subject: [PATCH 009/134] Update README.md --- apps/tapkb/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/tapkb/README.md b/apps/tapkb/README.md index 8fc7cece0..4f49b1494 100644 --- a/apps/tapkb/README.md +++ b/apps/tapkb/README.md @@ -1,4 +1,7 @@ -# Usage +# Tap Keyboard +This was originally designed for the Noteify app. With the new keyboard system in place, it has become its own keyboard app. +## Usage * Swipe left or right to cycle between the alphabet, numerals, and symbols. -* "New line" is represented by paragraph symbols (¶). When you hit the back button, these symbols will be converted into newline. \ No newline at end of file +* Hitting "caps" once will capitalize one character only. Hitting "caps" twice activates caps lock, and all subsequent characters will be capitalized until you hit "caps" again. +* "New line" is represented by a pilcrow (¶). When you hit the back button, these symbols will be converted into newline. From ad4a99a04c620283ec5add763cba4267cedef16b Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sun, 24 Apr 2022 18:50:29 +0200 Subject: [PATCH 010/134] First commit for the next version of ActivityReminder: tweaking some values --- apps/activityreminder/ChangeLog | 1 + apps/activityreminder/app.js | 2 +- apps/activityreminder/lib.js | 8 ++++---- apps/activityreminder/metadata.json | 4 ++-- apps/activityreminder/settings.js | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/activityreminder/ChangeLog b/apps/activityreminder/ChangeLog index 5560f00bc..53e29a66d 100644 --- a/apps/activityreminder/ChangeLog +++ b/apps/activityreminder/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Fix the settings bug and some tweaking diff --git a/apps/activityreminder/app.js b/apps/activityreminder/app.js index 9fb52e9ac..310dc10b0 100644 --- a/apps/activityreminder/app.js +++ b/apps/activityreminder/app.js @@ -15,7 +15,7 @@ function drawAlert(){ }); Bangle.buzz(400); - setTimeout(load, 10000); + setTimeout(load, 20000); } function run(){ diff --git a/apps/activityreminder/lib.js b/apps/activityreminder/lib.js index fee30e4c3..712842fba 100644 --- a/apps/activityreminder/lib.js +++ b/apps/activityreminder/lib.js @@ -6,17 +6,17 @@ exports.loadSettings = function() { maxInnactivityMin: 30, dismissDelayMin: 15, minSteps: 50 - }, require("Storage").readJSON("ar.settings.json", true) || {}); + }, require("Storage").readJSON("activityreminder.s.json", true) || {}); }; exports.writeSettings = function(settings){ - require("Storage").writeJSON("ar.settings.json", settings); + require("Storage").writeJSON("activityreminder.s.json", settings); }; exports.saveStepsArray = function(stepsArray) { - require("Storage").writeJSON("ar.stepsarray.json", stepsArray); + require("Storage").writeJSON("activityreminder.sa.json", stepsArray); }; exports.loadStepsArray = function(){ - return require("Storage").readJSON("ar.stepsarray.json") || []; + return require("Storage").readJSON("activityreminder.sa.json") || []; }; \ No newline at end of file diff --git a/apps/activityreminder/metadata.json b/apps/activityreminder/metadata.json index bc31776d6..260baafba 100644 --- a/apps/activityreminder/metadata.json +++ b/apps/activityreminder/metadata.json @@ -3,7 +3,7 @@ "name": "Activity Reminder", "shortName":"Activity Reminder", "description": "A reminder to take short walks for the ones with a sedentary lifestyle", - "version":"0.01", + "version":"0.02", "icon": "app.png", "type": "app", "tags": "tool,activity", @@ -17,6 +17,6 @@ {"name": "activityreminder.img", "url": "app-icon.js", "evaluate": true} ], "data": [ - {"name": "ar.settings.json", "name": "ar.stepsarray.json"} + {"name": "activityreminder.s.json", "name": "activityreminder.sa.json"} ] } diff --git a/apps/activityreminder/settings.js b/apps/activityreminder/settings.js index 65a19feb2..0b8f0542e 100644 --- a/apps/activityreminder/settings.js +++ b/apps/activityreminder/settings.js @@ -32,7 +32,7 @@ }, 'Max innactivity': { value: 30|settings.maxInnactivityMin, - min: 15, max: 60, + min: 15, max: 120, onchange: v => { settings.maxInnactivityMin = v; require("activityreminder").writeSettings(settings); From a9d8d52beb8bcd38ecc3237a7c347af058191763 Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sun, 24 Apr 2022 19:15:57 +0200 Subject: [PATCH 011/134] add logs for debug --- apps/activityreminder/settings.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/activityreminder/settings.js b/apps/activityreminder/settings.js index 0b8f0542e..6e25bc6d6 100644 --- a/apps/activityreminder/settings.js +++ b/apps/activityreminder/settings.js @@ -2,6 +2,9 @@ // Load settings var settings = require("activityreminder").loadSettings(); + console.log('In settings') + console.log(settings); + // Show the menu E.showMenu({ "" : { "title" : "Activity Reminder" }, From 2f67e5c0ed60ae87d13329a494fffc6a849de1b1 Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sun, 24 Apr 2022 19:25:11 +0200 Subject: [PATCH 012/134] Try to fix the settings issue --- apps/activityreminder/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/activityreminder/settings.js b/apps/activityreminder/settings.js index 6e25bc6d6..f26753820 100644 --- a/apps/activityreminder/settings.js +++ b/apps/activityreminder/settings.js @@ -34,7 +34,7 @@ } }, 'Max innactivity': { - value: 30|settings.maxInnactivityMin, + value: settings.maxInnactivityMin, min: 15, max: 120, onchange: v => { settings.maxInnactivityMin = v; From d63eb7e003608630801ce58a40a4904c9c05d095 Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sun, 24 Apr 2022 19:35:50 +0200 Subject: [PATCH 013/134] Fix settings issue --- apps/activityreminder/settings.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/activityreminder/settings.js b/apps/activityreminder/settings.js index f26753820..249af0c54 100644 --- a/apps/activityreminder/settings.js +++ b/apps/activityreminder/settings.js @@ -10,7 +10,7 @@ "" : { "title" : "Activity Reminder" }, "< Back" : () => back(), 'Enable': { - value: !!settings.enabled, + value: settings.enabled, format: v => v?"Yes":"No", onchange: v => { settings.enabled = v; @@ -18,7 +18,7 @@ } }, 'Start hour': { - value: 9|settings.startHour, + value: settings.startHour, min: 0, max: 24, onchange: v => { settings.startHour = v; @@ -26,7 +26,7 @@ } }, 'End hour': { - value: 20|settings.endHour, + value: settings.endHour, min: 0, max: 24, onchange: v => { settings.endHour = v; @@ -42,7 +42,7 @@ } }, 'Dismiss delay': { - value: 10|settings.dismissDelayMin, + value: settings.dismissDelayMin, min: 5, max: 15, onchange: v => { settings.dismissDelayMin = v; @@ -50,7 +50,7 @@ } }, 'Min steps': { - value: 50|settings.minSteps, + value: settings.minSteps, min: 10, max: 500, onchange: v => { settings.minSteps = v; From cbbab7c04c690bbd60a5a121f785f749269ff77f Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sun, 24 Apr 2022 19:42:35 +0200 Subject: [PATCH 014/134] Fix settings bug --- apps/terminalclock/ChangeLog | 1 + apps/terminalclock/metadata.json | 2 +- apps/terminalclock/settings.js | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/terminalclock/ChangeLog b/apps/terminalclock/ChangeLog index 14159bc19..4e53f6f8b 100644 --- a/apps/terminalclock/ChangeLog +++ b/apps/terminalclock/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App! 0.02: Rename "Activity" in "Motion" and display the true values for it 0.03: Add Banglejs 1 compatibility +0.04: Fix settings bug diff --git a/apps/terminalclock/metadata.json b/apps/terminalclock/metadata.json index de369bf10..a34602913 100644 --- a/apps/terminalclock/metadata.json +++ b/apps/terminalclock/metadata.json @@ -3,7 +3,7 @@ "name": "Terminal Clock", "shortName":"Terminal Clock", "description": "A terminal cli like clock displaying multiple sensor data", - "version":"0.03", + "version":"0.04", "icon": "app.png", "type": "clock", "tags": "clock", diff --git a/apps/terminalclock/settings.js b/apps/terminalclock/settings.js index 77df69b12..6b686058b 100644 --- a/apps/terminalclock/settings.js +++ b/apps/terminalclock/settings.js @@ -18,7 +18,7 @@ "" : { "title" : "Terminal Clock" }, "< Back" : () => back(), 'HR confidence': { - value: 50|settings.HRMinConfidence, // 0| converts undefined to 0 + value: settings.HRMinConfidence, min: 0, max: 100, onchange: v => { settings.HRMinConfidence = v; @@ -26,7 +26,7 @@ } }, 'Show date': { - value: !!settings.showDate, + value: settings.showDate, format: v => v?"Yes":"No", onchange: v => { settings.showDate = v; @@ -34,7 +34,7 @@ } }, 'Show HRM': { - value: !!settings.showHRM, + value: settings.showHRM, format: v => v?"Yes":"No", onchange: v => { settings.showHRM = v; @@ -42,7 +42,7 @@ } }, 'Show Activity': { - value: !!settings.showActivity, + value: settings.showActivity, format: v => v?"Yes":"No", onchange: v => { settings.showActivity = v; @@ -50,7 +50,7 @@ } }, 'Show Steps': { - value: !!settings.showStepCount, + value: settings.showStepCount, format: v => v?"Yes":"No", onchange: v => { settings.showStepCount = v; From 3a7e67d56b27193a6492b98e538e4f067de52b3a Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sun, 24 Apr 2022 19:57:18 +0200 Subject: [PATCH 015/134] remove debug logs --- apps/activityreminder/settings.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/activityreminder/settings.js b/apps/activityreminder/settings.js index 249af0c54..bdd105781 100644 --- a/apps/activityreminder/settings.js +++ b/apps/activityreminder/settings.js @@ -2,9 +2,6 @@ // Load settings var settings = require("activityreminder").loadSettings(); - console.log('In settings') - console.log(settings); - // Show the menu E.showMenu({ "" : { "title" : "Activity Reminder" }, From 499ec22dd82d74ebd76cb027dccadf04479ad1be Mon Sep 17 00:00:00 2001 From: Alessandro Cocco Date: Sat, 23 Apr 2022 22:49:06 +0200 Subject: [PATCH 016/134] [AppLoader] Add new chips --- index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.html b/index.html index 7a94f684a..a3f358bc2 100644 --- a/index.html +++ b/index.html @@ -75,11 +75,14 @@
+ + +