diff --git a/apps/ac_ac/ChangeLog.txt b/apps/ac_ac/ChangeLog similarity index 100% rename from apps/ac_ac/ChangeLog.txt rename to apps/ac_ac/ChangeLog diff --git a/apps/arrow/README.md b/apps/arrow/README.md index 4b77dbc42..2833eab24 100644 --- a/apps/arrow/README.md +++ b/apps/arrow/README.md @@ -43,3 +43,7 @@ charge. This app is based in the work done by [jeffmer](https://github.com/jeffmer/JeffsBangleAppsDev) + +Written by: [Hugh Barney](https://github.com/hughbarney) For support +and discussion please post in the [Bangle JS +Forum](http://forum.espruino.com/microcosms/1424/) diff --git a/apps/barometer/ChangeLog b/apps/barometer/ChangeLog index 031a86cdc..de3a5cb96 100644 --- a/apps/barometer/ChangeLog +++ b/apps/barometer/ChangeLog @@ -1,2 +1,3 @@ 0.01: Display pressure as number and hand 0.02: Use theme color +0.03: workaround for some firmwares that return 'undefined' for first call to barometer diff --git a/apps/barometer/app.js b/apps/barometer/app.js index 2ce95864b..77d4c974f 100644 --- a/apps/barometer/app.js +++ b/apps/barometer/app.js @@ -110,9 +110,13 @@ drawScaleLabels(); drawIcons(); try { - Bangle.getPressure().then(data => { - drawHand(Math.round(data.pressure)); - }); + function baroHandler(data) { + if (data===undefined) // workaround for https://github.com/espruino/BangleApps/issues/1429 + setTimeout(() => Bangle.getPressure().then(baroHandler), 500); + else + drawHand(Math.round(data.pressure)); + } + Bangle.getPressure().then(baroHandler); } catch(e) { print(e.message); print("barometer not supporter, show a demo value"); diff --git a/apps/barometer/metadata.json b/apps/barometer/metadata.json index 68af55c68..a385f2be2 100644 --- a/apps/barometer/metadata.json +++ b/apps/barometer/metadata.json @@ -1,7 +1,7 @@ { "id": "barometer", "name": "Barometer", "shortName":"Barometer", - "version":"0.02", + "version":"0.03", "description": "A simple barometer that displays the current air pressure", "icon": "barometer.png", "tags": "tool,outdoors", diff --git a/apps/boot/ChangeLog b/apps/boot/ChangeLog index 702a8091e..4c3d3b930 100644 --- a/apps/boot/ChangeLog +++ b/apps/boot/ChangeLog @@ -45,3 +45,4 @@ 0.39: Fix passkey support (fix https://github.com/espruino/Espruino/issues/2035) 0.40: Bootloader now rebuilds for new firmware versions 0.41: Add Keyboard and Mouse Bluetooth HID option +0.42: Sort *.boot.js files lexically and by optional numeric priority, e.g. appname..boot.js diff --git a/apps/boot/bootupdate.js b/apps/boot/bootupdate.js index 1b826de5a..63424bfbf 100644 --- a/apps/boot/bootupdate.js +++ b/apps/boot/bootupdate.js @@ -195,7 +195,19 @@ if (!Bangle.appRect) { // added in 2v11 - polyfill for older firmwares // Append *.boot.js files // These could change bleServices/bleServiceOptions if needed -require('Storage').list(/\.boot\.js/).forEach(bootFile=>{ +var getPriority = /.*\.(\d+)\.boot\.js$/; +require('Storage').list(/\.boot\.js/).sort((a,b)=>{ + var aPriority = a.match(getPriority); + var bPriority = b.match(getPriority); + if (aPriority && bPriority){ + return parseInt(aPriority[1]) - parseInt(bPriority[1]); + } else if (aPriority && !bPriority){ + return -1; + } else if (!aPriority && bPriority){ + return 1; + } + return a > b; +}).forEach(bootFile=>{ // we add a semicolon so if the file is wrapped in (function(){ ... }() // with no semicolon we don't end up with (function(){ ... }()(function(){ ... }() // which would cause an error! diff --git a/apps/boot/metadata.json b/apps/boot/metadata.json index ebbf762c0..4cbfd9c59 100644 --- a/apps/boot/metadata.json +++ b/apps/boot/metadata.json @@ -1,7 +1,7 @@ { "id": "boot", "name": "Bootloader", - "version": "0.41", + "version": "0.42", "description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings", "icon": "bootloader.png", "type": "bootloader", diff --git a/apps/bowserWF/README.md b/apps/bowserWF/README.md new file mode 100644 index 000000000..19dc84c83 --- /dev/null +++ b/apps/bowserWF/README.md @@ -0,0 +1,6 @@ +# Bowser Watchface + +Show your evil character. +With style! + +Bowser jumps once every minute to advance the clock. hehe diff --git a/apps/bowserWF/app-icon.js b/apps/bowserWF/app-icon.js new file mode 100644 index 000000000..7d040b0ad --- /dev/null +++ b/apps/bowserWF/app-icon.js @@ -0,0 +1 @@ +E.toArrayBuffer(atob("Ly+EARERERERERERERERER//8RERERERERERERERERERERERERERERzP//d3EREREREREREREREREREREREREcz//3dxERERERERERERERERERERERERHMz/93dxERERERERERERERERERERERERd8zHd3f/8REREREREREREREREREREREXfMx3d3//ERERERERERERERERERERERF3d3d3d//3cRHBEREREREREREREREREXd3d3d3f/93fMDMERERERERERERERERF3d3d3d3//d3zAzBERERERERERERERERd3d3fMd3f//8zMwREREREREREREREREXd3d8zMd3f/zMzMERERERERERERERERF3d3fMzHd3/8zMzBERERERERER93d3//d3d3x3/Mx3fMzP8REREREREXzP/3d//3d3d8d3fMzMz/8RERERERERF8z/93f/93d3fHd3zMzM//ERERER//93zM//93//d3d3z/d/9////xEREREcz/d3zM/3d///d3d8zHERH/ERERERERHM/3d8zP93f//3d3fMxxER/xERERER/3zMd3d3d3d3f///d3zM8REREREREREf93d3d3d3d3d3d///d3zMERERERERERH/d3d3d3d3d3d3f//3d8zBERERERERERd3d3f///d3d3d3//93fMzP8RERERERH//3d3zP/3d//////3d3d8wRERERERER//93d8z/93f/////93d3fMEREREREREc//d3fMx3f//MzMd3d3d3dxERERERERHMx3d3d3d//8zMAPd3zMzHERERERERH/d3d3d3d3f3fMzwDMzAD8zBERERERER/3d3d3d3d393zM8AzMwA/MwRERERERH913d///d3d/d3AAzMzMAAzMERERERERREd3fM/3d//3d//MzMzMwP/BEREREREURHd3zP93f/93f/zMzMzMD/wRERERERFP/3d8zHd3//d3d3zMzMzAAMERERERER//93d3d3d//3d3d8zMzMwP8BEREREREf//d3d3d3f/93d3fMzMzMD/ARERERERFMzHf/93d3/3d3d3EczM/wABERERERERR3x3fMd3f/93d3dxEREREREREREREREUd8d3zHd3//d3d3cRERERERERERERERFHd3d3d///d3d3dxERERERERERERERERR3d3f///93d3dxEREREREREREREREREUd3d3////d3d3cRERERERERERERERERH//////3d3d3d8ERERERERERERERERER/////MzMx3fMz/8REREREREREREREREf////zMzMd3zM//EREREREREREREREREf/8zMzMzMzMzP//ERERERERERERERERERzMzM/8zP/xEREREREREREREREREREREczMzP/Mz/8REREREREREREREREREREczMzMz//8///xERERERERERERERERERA=")) diff --git a/apps/bowserWF/app.js b/apps/bowserWF/app.js new file mode 100644 index 000000000..e53d945cc --- /dev/null +++ b/apps/bowserWF/app.js @@ -0,0 +1,102 @@ +var sprite = { + width : 47, height : 47, bpp : 3, + transparent : 1, + buffer : require("heatshrink").decompress(atob("kmSpICFn/+BAwCImV//VICJuT//SogRMpmT/2SCJtSyQDB/4RMymRkmX/gRLygDC3/piVhCJElAYf/pNIkgRIlIDCl/6pVBkIRIGwWJEYPypMJCI9KGwQRBLANIPRI2CGoPkyVCBwmeyVLTYNJom8yImBz4gEqV/6Vf+g2BPwf/IIq8C/+kyVRkgDBp/5CIX/+mkz/+y/9BIOf0v6///5LdCz+kCIOk34RBYQMSp5XBGQVk/pNBAQP/9IyBxGSv4yCk/1OIK8EC4QgEpM/JgJ+EGoIRBTApQCEYvplLOFXIIdBO4SqBeQJABGoeTDQMlk5WCAAPSYQLgEz4aBlM/9IgB/7CCcAvP/QsBiVfUwOJBgUiCIcmpAVCy/+pMAKwMkRgIRCp6VBAwW6qVOgmSgPkwgRDv53E6WSuEkyEPRgmf2VJv5HBl2SgAKBwEJRgnJiVKp/Sr/0y/yBQOQv56DKwVSv2STwO/DgWD/BADmaDByRoBYoQRCgFCCIf/+jgDNwOUAwMg/kSPQbODX4IJBAwUH8B6DsmRl5oBl7OBklMyV+gBoDycSxMpiVLZwS8EAQeYyjaByR6BBIJBDAQnEIgbFCogOFRgQDBr//I4L0EAQsxAYP//5WCGQ6MCAAKbCpKYEAQiMB//kIQOUyf+CJF/CIIEBTYOfcgQRHBQv/CJKnBpP8GRTCDJIPkGRQCB5I3C/n/EZUgA")) +}; + +const boxes = { + width : 122, height : 56, bpp : 3, + transparent : 1, + buffer : require("heatshrink").decompress(atob("kmZkmSpICPwgDBmQUQAQMJAYNkFiOSiQDB5JESAYQsSpADByYsSyBZBydt23bAR+wgFJkwUQAQNggGSposR23AgMkzZESwECpM2IiUAgmSFiW2gDlBFiVsgDlBFiXYgDNBL4MDWZy2FgEGWZy2FgENWZy2EL4MbWZpTBWwZfBXJpTCWwZiCWZpTBWwZiCWZsbWwhiCWZpWCWwTORWwgXRWwgXRWwZESWwZESWwZESWwYXRWwgXRW362/W362/W362/W362/W362/W362/W362/W362/W362/W362/WwuAgazOWwsAgyzOWwsAhqzOWwhfBjazNKYK2DL4K5NKYS2DMQSzNKYK2DMQSzNja2EMQSzNKwS2CZyK2EC6K2EC6K2DIiS2DIiS2DIiUAFoMAAFTkBFtckyAtrLgWSpICnLIIsqyVAgAsqpIA=")) +}; + +const background = { + width : 176, height : 176, bpp : 3, + transparent : 5, + buffer : require("heatshrink").decompress(atob("kmSpIC/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/ATWAgEAIP1///8iRB8gf/AAOCIPdIIARBBoJB/+E4IP4ABghB9v4CB8BB5g/92//9pB7wP/97FEIO9IgDACAAn8iVBIOlHH4xBDnA+wyY9IAAmB/BB//5B/IOQ/OAARBup5B/yV/IP5B/IP5BRt5B7/wDC7aD8/w+B+3bBgP7IP5B7HYNt23/AQPfIPX/9oCC24IDINwCBIRAAHIOACBHI3+g4EC/l/4BByAQkA//wpED//4gGAhJB3pMAgQFBgEBH3AC/AX4C/AX4C/AX4C/AX4C/AUOAgBB/v//ghB9gf///gH3UgiVIIAJBBwRB5j+CIIf8uBB5//wIIXb//+hJB6o/92/7v5B7/0/97GCIPYAG4MgIP/BjkSIP34/hB//5B/AAQ+0IP5B/IP5BN7ZB97///wCBIPX93yAB2wCB+5B5tv//dt24CB35B5v/+n/t+P/I4PH8ESIO38gFA/+CgH/+EIgiD3gACCPoMAgQ+2AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/AX4C/ASVIgAACgRB/IPY8GkAHBiRB/IPBLKgJB/IP5B/AQUAkmQghB/IP2AgEAyVAiRB/IP5BBpMAIP5B/IIUkgBB/IP5BpoAsBgJBOgEEIIoIBIP5BlyE27dt2EEIJ4CBBAlIgRBgpEAhu2IIO24ESQwxB/IJQhGkEJIL8GHwQCDgOweQpB/IKMkwAKJILVgAofYeQhBzsEAIKICLoESILmBQARBBtuwgZB3kA4B4ENIgJBcpMAIMYCDIOcAgEbHYgCGsEJkhEBE6cBIP5BZfYQ+JIIkDsEBIP5BVyEAIKtAHxgCDwBEBINk2IKCGCIKmSpECIP5BUkEBHyACD2BBUFoMJIP5BSpEbHyQCDIP5BXkmAIP5B/AQcAbKJB/ILH/AAP8hM/AgWSv4KCAAP+gmfAoXJk4ME//gpIEC8mTBgvwkgEC+QRDAAX4gVPAgP5kgsCLwWQh/kMIUf5LuFg4jBAoMBKAJ5EwF/AoUA/yFFoE/CI6RDgY+BCIQsDIP5B/IP5B/IP5B/IJ/AIJfghJBKv0EIJcAIJfwIP5BMhMAAAMEz5BGgmABoVJII9IBgUkII8kBgUSII8CoAMBhJB/IIsQoMAYoP/AAP4YpAMC/+BII9/BgXAYpAMC8DFIBgXwIIcCIP6DCgkQh/kCIRBIbQcBIJAFCgBBICI5BE/IRDFgQA=")) +}; + +numbersDims = { + width: 20, + height: 44 +}; +const numbers = [ + require("heatshrink").decompress(atob("ikswcBkmSpIC/ARGQKYQIDAwUEBxMAAQNAgECpMgAQMkB4IOIAQQLCgEQBwQaBgEBB1oCBBwYCCiRWDCIRWEO5wOHAX4CnA=")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/ARNIKYIIEwEAggOKNIQODyAHCBxQsWB3TUFgMgA4sSBwzU/AVA=")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/AQ8gKggIBAwkCBw+QCIQLCgIRCDQcQBwwyDDwUSCgVAAwIOBEwI7EpI7FBw4FDghZGHwgOEF4Y+CEYQ+DBxQADNAIAFNAIOFa/4CoA=")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/AQ8gKosSAwsBBw4aCoEAgQjEBoIpEBwtIBoIUEwEAggUDBwwyDDoWQA4ZWHhIIEJQoOCgI+EBwMQEAYOJO4oLBO4oRDJQrX/AU4")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/ARNIKgQIDwAGBgQOJNQYOCyAHDBxEggB6BBwYDBiVABxIjBCIIODF4YOEAAkBV40QBwxiDNAosEB0IC/AUg")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/AQ5UFkmQAwkCBxIdGCIIIDBxAsTgAaEkEASooOBiQOVJQgOBiBKDBxMSJQwRBLIgRCBwjX/AVA=")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/ARGQKgYICAwcCBxADBiQdDkEANYoOGEAYyEHYoOIHYqfFBxIdDBAMQFgZHCBysSFgwRBO46GFa/4CnA")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/AQ5VGiAGFgIOIDQUgBwUCEYQOJGQYNBHAlADQgOHwEAggUDpANBCgYpBBwmQAwJiGhIjDB1gC/AU4A=")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/AQ8gKYYICAwcEBxGQgAaDgVJgACBDQQOJgB6CBwcAiQODHa4AEhIRBpAHDiARBwAGCgIgCFIYOCFIYOHiQrEJQxlCBwzX/AVAA=")), + require("heatshrink").decompress(atob("ikswcBkmSpIC/AQ8gKggIBAwkCBw+QCIQLCgIRCDQcQBzkSTAsBHYoOIL4gOCMooOENAYOCoA4EBwoqDgiGGF4gOEa/4CoA=")), +]; +digitPositions = [ // relative to the box + {x:13, y:6}, {x:32, y:6}, + {x:74, y:6}, {x:93, y:6}, +]; + +var drawTimeout; +const animation_duration = 1; // seconds +const animation_steps = 20; +const jump_height = 45; // top coordinate of the jump +const seconds_per_minute = 60; + +function draw() { + const now = new Date(); + g.drawImage(background, 0, 0); + var boxTL_x = 27; var boxTL_y = 29; + var sprite_TL_x = 72; var sprite_TL_y = 161 - sprite.height; + const seconds = now.getSeconds()%seconds_per_minute + now.getMilliseconds()/1000; + const hours = now.getHours(); + const minutes = now.getMinutes(); + + var time_advance = seconds / animation_duration; + + if (time_advance < 0.5) { + sprite_TL_y += (jump_height - sprite_TL_y) * time_advance * 2; + } else if (time_advance < 1) { + sprite_TL_y = jump_height + (sprite_TL_y-jump_height) * (time_advance-0.5) * 2; + } + const box_penetration = boxTL_y + boxes.height - sprite_TL_y; + if (box_penetration > 0) { + boxTL_y -= box_penetration; + } + g.drawImage(boxes, boxTL_x, boxTL_y); + g.drawImage(numbers[(hours / 10) >> 0], boxTL_x+digitPositions[0].x, boxTL_y+digitPositions[0].y); + g.drawImage(numbers[(hours % 10) >> 0], boxTL_x+digitPositions[1].x, boxTL_y+digitPositions[1].y); + g.drawImage(numbers[(minutes / 10) >> 0], boxTL_x+digitPositions[2].x, boxTL_y+digitPositions[2].y); + g.drawImage(numbers[(minutes % 10) >> 0], boxTL_x+digitPositions[3].x, boxTL_y+digitPositions[3].y); + g.drawImage(sprite, sprite_TL_x, sprite_TL_y); + Bangle.drawWidgets(); + + const timeout = time_advance <= 1? + animation_duration / animation_steps + : (seconds_per_minute - seconds); + setTimeout( _=>{ + drawTimeout = undefined; + draw(); + }, timeout * 1000); +} + +// Clear the screen once, at startup +g.setTheme({bg:"#00f",fg:"#fff",dark:true}).clear(); + +Bangle.on('lcdPower',on=>{ + if (on) { + draw(); // draw immediately, queue redraw + } else { // stop draw timer + if (drawTimeout) { + clearTimeout(drawTimeout); + } + drawTimeout = undefined; + } +}); + +// Show launcher when middle button pressed +Bangle.setUI("clock"); +// Load widgets +Bangle.loadWidgets(); + +draw(); diff --git a/apps/bowserWF/app.png b/apps/bowserWF/app.png new file mode 100644 index 000000000..724d63078 Binary files /dev/null and b/apps/bowserWF/app.png differ diff --git a/apps/bowserWF/metadata.json b/apps/bowserWF/metadata.json new file mode 100644 index 000000000..22df2dea4 --- /dev/null +++ b/apps/bowserWF/metadata.json @@ -0,0 +1,14 @@ +{ "id": "bowserWF", + "name": "Bowser Watchface", + "shortName":"Bowser Watchface", + "version":"0.01", + "description": "Let bowser show you the time", + "icon": "app.png", + "tags": "", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"bowserWF.app.js","url":"app.js"}, + {"name":"bowserWF.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/bthrm/ChangeLog b/apps/bthrm/ChangeLog index 3354a19e8..58d002f22 100644 --- a/apps/bthrm/ChangeLog +++ b/apps/bthrm/ChangeLog @@ -17,3 +17,6 @@ 0.06: Fix bug if no request waiting time is set Fix bug if no connection data was cached Fix error during disconnect +0.07: Recorder icon only blue if values actually arive + Adds some preset modes and a custom one + Restructure the settings menu diff --git a/apps/bthrm/README.md b/apps/bthrm/README.md index f0c7775c2..42ad619bd 100644 --- a/apps/bthrm/README.md +++ b/apps/bthrm/README.md @@ -29,6 +29,7 @@ Heart Rate Service (`180D`) and characteristic (`2A37`). So far it has been tested on: * CooSpo Bluetooth Heart Rate Monitor +* Wahoo TICKR X 2 ## Internals @@ -36,7 +37,6 @@ This replaces `Bangle.setHRMPower` with its own implementation. ## TODO -* Maybe a `bthrm.settings.js` and app (that calls it) to enable it to be turned on and off * A widget to show connection state? * Specify a specific device by address? diff --git a/apps/bthrm/boot.js b/apps/bthrm/boot.js index 6ac6382d6..339f6f8c6 100644 --- a/apps/bthrm/boot.js +++ b/apps/bthrm/boot.js @@ -548,9 +548,7 @@ E.on("kill", ()=>{ if (gatt && gatt.connected){ log("Got killed, trying to disconnect"); - var promise = gatt.disconnect(); - promise.then(()=>log("Disconnected on kill")); - promise.catch((e)=>log("Error during disconnnect on kill", e)); + var promise = gatt.disconnect().then(()=>log("Disconnected on kill")).catch((e)=>log("Error during disconnnect on kill", e)); } }); } diff --git a/apps/bthrm/default.json b/apps/bthrm/default.json index c973eef25..64e638b8a 100644 --- a/apps/bthrm/default.json +++ b/apps/bthrm/default.json @@ -1,4 +1,5 @@ { + "mode": 1, "enabled": true, "replace": true, "debuglog": false, @@ -6,6 +7,12 @@ "allowFallback": true, "warnDisconnect": false, "fallbackTimeout": 10, + "custom_replace": false, + "custom_debuglog": false, + "custom_startWithHrm": false, + "custom_allowFallback": false, + "custom_warnDisconnect": false, + "custom_fallbackTimeout": 10, "gracePeriodNotification": 0, "gracePeriodConnect": 0, "gracePeriodService": 0, diff --git a/apps/bthrm/metadata.json b/apps/bthrm/metadata.json index 9aea5f3aa..1c21269e2 100644 --- a/apps/bthrm/metadata.json +++ b/apps/bthrm/metadata.json @@ -2,7 +2,7 @@ "id": "bthrm", "name": "Bluetooth Heart Rate Monitor", "shortName": "BT HRM", - "version": "0.06", + "version": "0.07", "description": "Overrides Bangle.js's build in heart rate monitor with an external Bluetooth one.", "icon": "app.png", "type": "app", @@ -12,7 +12,7 @@ "storage": [ {"name":"bthrm.app.js","url":"bthrm.js"}, {"name":"bthrm.recorder.js","url":"recorder.js"}, - {"name":"bthrm.boot.js","url":"boot.js"}, + {"name":"bthrm.0.boot.js","url":"boot.js"}, {"name":"bthrm.img","url":"app-icon.js","evaluate":true}, {"name":"bthrm.settings.js","url":"settings.js"}, {"name":"bthrm.default.json","url":"default.json"} diff --git a/apps/bthrm/recorder.js b/apps/bthrm/recorder.js index 938990362..21345a907 100644 --- a/apps/bthrm/recorder.js +++ b/apps/bthrm/recorder.js @@ -32,7 +32,7 @@ Bangle.removeListener('BTHRM', onHRM); if (Bangle.setBTRHMPower) Bangle.setBTHRMPower(0,"recorder"); }, - draw : (x,y) => g.setColor((Bangle.isBTHRMConnected && Bangle.isBTHRMConnected())?"#00f":"#88f").drawImage(atob("DAwBAAAAMMeef+f+f+P8H4DwBgAA"),x,y) + draw : (x,y) => g.setColor((bpm != "")?"#00f":"#88f").drawImage(atob("DAwBAAAAMMeef+f+f+P8H4DwBgAA"),x,y) }; } }) diff --git a/apps/bthrm/settings.js b/apps/bthrm/settings.js index 62d2e7ea3..beefb00e9 100644 --- a/apps/bthrm/settings.js +++ b/apps/bthrm/settings.js @@ -20,182 +20,147 @@ var mainmenu = { '': { 'title': 'Bluetooth HRM' }, '< Back': back, - 'Use BT HRM': { - value: !!settings.enabled, - format: v => settings.enabled ? "On" : "Off", + 'Mode': { + value: 0 | settings.mode, + min: 0, + max: 3, + format: v => ["Off", "Default", "Both", "Custom"][v], onchange: v => { - writeSettings("enabled",v); + settings.mode = v; + switch (v){ + case 0: + writeSettings("enabled",false); + break; + case 1: + writeSettings("enabled",true); + writeSettings("replace",true); + writeSettings("debuglog",false); + writeSettings("startWithHrm",true); + writeSettings("allowFallback",true); + writeSettings("fallbackTimeout",10); + break; + case 2: + writeSettings("enabled",true); + writeSettings("replace",false); + writeSettings("debuglog",false); + writeSettings("startWithHrm",false); + writeSettings("allowFallback",false); + break; + case 3: + writeSettings("enabled",true); + writeSettings("replace",settings.custom_replace); + writeSettings("debuglog",settings.custom_debuglog); + writeSettings("startWithHrm",settings.custom_startWithHrm); + writeSettings("allowFallback",settings.custom_allowFallback); + writeSettings("fallbackTimeout",settings.custom_fallbackTimeout); + break; + } + writeSettings("mode",v); } }, - 'Replace HRM': { - value: !!settings.replace, - format: v => settings.replace ? "On" : "Off", - onchange: v => { - writeSettings("replace",v); - } - }, - 'Start with HRM': { - value: !!settings.startWithHrm, - format: v => settings.startWithHrm ? "On" : "Off", - onchange: v => {(function(back) { - function writeSettings(key, value) { - var s = require('Storage').readJSON(FILE, true) || {}; - s[key] = value; - require('Storage').writeJSON(FILE, s); - readSettings(); - } + 'Custom Mode': function() { E.showMenu(submenu_custom); }, + 'Debug': function() { E.showMenu(submenu_debug); } + }; - function readSettings(){ - settings = Object.assign( - require('Storage').readJSON("bthrm.default.json", true) || {}, - require('Storage').readJSON(FILE, true) || {} - ); - } - - var FILE="bthrm.json"; - var settings; - readSettings(); - - var mainmenu = { - '': { 'title': 'Bluetooth HRM' }, - '< Back': back, - 'Use BT HRM': { - value: !!settings.enabled, - format: v => settings.enabled ? "On" : "Off", + var submenu_debug = { + '' : { title: "Debug"}, + '< Back': function() { E.showMenu(mainmenu); }, + 'Alert on disconnect': { + value: !!settings.warnDisconnect, + format: v => settings.warnDisconnect ? "On" : "Off", onchange: v => { - writeSettings("enabled",v); + writeSettings("warnDisconnect",v); } }, - 'Replace HRM': { - value: !!settings.replace, - format: v => settings.replace ? "On" : "Off", + 'Debug log': { + value: !!settings.debuglog, + format: v => settings.debuglog ? "On" : "Off", onchange: v => { - writeSettings("replace",v); + writeSettings("debuglog",v); + } + }, + 'Grace periods': function() { E.showMenu(submenu_grace); } + }; + + var submenu_custom = { + '' : { title: "Custom mode"}, + '< Back': function() { E.showMenu(mainmenu); }, + 'Replace HRM': { + value: !!settings.custom_replace, + format: v => settings.custom_replace ? "On" : "Off", + onchange: v => { + writeSettings("custom_replace",v); } }, 'Start w. HRM': { - value: !!settings.startWithHrm, - format: v => settings.startWithHrm ? "On" : "Off", + value: !!settings.custom_startWithHrm, + format: v => settings.custom_startWithHrm ? "On" : "Off", onchange: v => { - writeSettings("startWithHrm",v); + writeSettings("custom_startWithHrm",v); } }, 'HRM Fallback': { - value: !!settings.allowFallback, - format: v => settings.allowFallback ? "On" : "Off", + value: !!settings.custom_allowFallback, + format: v => settings.custom_allowFallback ? "On" : "Off", onchange: v => { - writeSettings("allowFallback",v); + writeSettings("custom_allowFallback",v); } }, 'Fallback Timeout': { - value: settings.fallbackTimeout, + value: settings.custom_fallbackTimeout, min: 5, max: 60, step: 5, format: v=>v+"s", onchange: v => { - writeSettings("fallbackTimout",v*1000); + writeSettings("custom_fallbackTimout",v*1000); } }, - 'Conn. Alert': { - value: !!settings.warnDisconnect, - format: v => settings.warnDisconnect ? "On" : "Off", + }; + + var submenu_grace = { + '' : { title: "Grace periods"}, + '< Back': function() { E.showMenu(submenu_debug); }, + 'Request': { + value: settings.gracePeriodRequest, + min: 0, + max: 3000, + step: 100, + format: v=>v+"ms", onchange: v => { - writeSettings("warnDisconnect",v); + writeSettings("gracePeriodRequest",v); } }, - 'Debug log': { - value: !!settings.debuglog, - format: v => settings.debuglog ? "On" : "Off", + 'Connect': { + value: settings.gracePeriodConnect, + min: 0, + max: 3000, + step: 100, + format: v=>v+"ms", onchange: v => { - writeSettings("debuglog",v); + writeSettings("gracePeriodConnect",v); } }, - 'Grace periods >': function() { E.showMenu(submenu); } - }; - - var submenu = { - '' : { title: "Grace periods"}, - '< Back': function() { E.showMenu(mainmenu); }, - 'Request': { - value: settings.gracePeriodRequest, - min: 0, - max: 3000, - step: 100, - format: v=>v+"ms", - onchange: v => { - writeSettings("gracePeriodRequest",v); - } - }, - 'Connect': { - value: settings.gracePeriodConnect, - min: 0, - max: 3000, - step: 100, - format: v=>v+"ms", - onchange: v => { - writeSettings("gracePeriodConnect",v); - } - }, - 'Notification': { - value: settings.gracePeriodNotification, - min: 0, - max: 3000, - step: 100, - format: v=>v+"ms", - onchange: v => { - writeSettings("gracePeriodNotification",v); - } - }, - 'Service': { - value: settings.gracePeriodService, - min: 0, - max: 3000, - step: 100, - format: v=>v+"ms", - onchange: v => { - writeSettings("gracePeriodService",v); - } - } - }; - - E.showMenu(mainmenu); -}) - writeSettings("startWithHrm",v); - } - }, - 'Fallback to HRM': { - value: !!settings.allowFallback, - format: v => settings.allowFallback ? "On" : "Off", - onchange: v => { - writeSettings("allowFallback",v); - } - }, - 'Fallback Timeout': { - value: settings.fallbackTimeout, - min: 5, - max: 60, - step: 5, - format: v=>v+"s", - onchange: v => { - writeSettings("fallbackTimout",v*1000); - } - }, - 'Conn. Alert': { - value: !!settings.warnDisconnect, - format: v => settings.warnDisconnect ? "On" : "Off", - onchange: v => { - writeSettings("warnDisconnect",v); - } - }, - 'Debug log': { - value: !!settings.debuglog, - format: v => settings.debuglog ? "On" : "Off", - onchange: v => { - writeSettings("debuglog",v); - } - }, - 'Grace periods': function() { E.showMenu(submenu); } + 'Notification': { + value: settings.gracePeriodNotification, + min: 0, + max: 3000, + step: 100, + format: v=>v+"ms", + onchange: v => { + writeSettings("gracePeriodNotification",v); + } + }, + 'Service': { + value: settings.gracePeriodService, + min: 0, + max: 3000, + step: 100, + format: v=>v+"ms", + onchange: v => { + writeSettings("gracePeriodService",v); + } + } }; var submenu = { diff --git a/apps/contourclock/ChangeLog b/apps/contourclock/ChangeLog index b8d01ff86..0b6709d24 100644 --- a/apps/contourclock/ChangeLog +++ b/apps/contourclock/ChangeLog @@ -3,3 +3,4 @@ 0.21: Fixed settings menu, four more fonts 0.22: Changed timing code, original "Nunito" Font is back! 0.23: Customizer! Unused fonts no longer take up precious memory. +0.24: Added previews to the customizer. diff --git a/apps/contourclock/custom.html b/apps/contourclock/custom.html index 7d780d39c..602182573 100644 --- a/apps/contourclock/custom.html +++ b/apps/contourclock/custom.html @@ -1,70 +1,74 @@ + +

   Select Fonts to upload:

-
+
-
+
-
+
-
- -
+
-
+
-
+
-
+
-
+
-
- -
+
-
+
-
+
-
+
-
-

Click

+
+

+ if (n>0) + sendCustomizedApp({storage:fonts}); + else + alert("Please select at least one Font!"); + }); + +
diff --git a/apps/contourclock/fonts/BarlowCond-p1.png b/apps/contourclock/fonts/BarlowCond-p1.png new file mode 100644 index 000000000..fc1e66797 Binary files /dev/null and b/apps/contourclock/fonts/BarlowCond-p1.png differ diff --git a/apps/contourclock/fonts/BarlowCond-p2.png b/apps/contourclock/fonts/BarlowCond-p2.png new file mode 100644 index 000000000..09f0cd5b6 Binary files /dev/null and b/apps/contourclock/fonts/BarlowCond-p2.png differ diff --git a/apps/contourclock/fonts/BebasNeue-p1.png b/apps/contourclock/fonts/BebasNeue-p1.png new file mode 100644 index 000000000..7bcec6894 Binary files /dev/null and b/apps/contourclock/fonts/BebasNeue-p1.png differ diff --git a/apps/contourclock/fonts/BebasNeue-p2.png b/apps/contourclock/fonts/BebasNeue-p2.png new file mode 100644 index 000000000..9ef333b06 Binary files /dev/null and b/apps/contourclock/fonts/BebasNeue-p2.png differ diff --git a/apps/contourclock/fonts/Dekko-p1.png b/apps/contourclock/fonts/Dekko-p1.png new file mode 100644 index 000000000..de2da2646 Binary files /dev/null and b/apps/contourclock/fonts/Dekko-p1.png differ diff --git a/apps/contourclock/fonts/Dekko-p2.png b/apps/contourclock/fonts/Dekko-p2.png new file mode 100644 index 000000000..d82129543 Binary files /dev/null and b/apps/contourclock/fonts/Dekko-p2.png differ diff --git a/apps/contourclock/fonts/DinAlternate-p1.png b/apps/contourclock/fonts/DinAlternate-p1.png new file mode 100644 index 000000000..5957d2c5a Binary files /dev/null and b/apps/contourclock/fonts/DinAlternate-p1.png differ diff --git a/apps/contourclock/fonts/DinAlternate-p2.png b/apps/contourclock/fonts/DinAlternate-p2.png new file mode 100644 index 000000000..fdc9b38a3 Binary files /dev/null and b/apps/contourclock/fonts/DinAlternate-p2.png differ diff --git a/apps/contourclock/fonts/Impact-p1.png b/apps/contourclock/fonts/Impact-p1.png new file mode 100644 index 000000000..5ce675ba4 Binary files /dev/null and b/apps/contourclock/fonts/Impact-p1.png differ diff --git a/apps/contourclock/fonts/Impact-p2.png b/apps/contourclock/fonts/Impact-p2.png new file mode 100644 index 000000000..0474caea8 Binary files /dev/null and b/apps/contourclock/fonts/Impact-p2.png differ diff --git a/apps/contourclock/fonts/Nunito-p1.png b/apps/contourclock/fonts/Nunito-p1.png new file mode 100644 index 000000000..44697c671 Binary files /dev/null and b/apps/contourclock/fonts/Nunito-p1.png differ diff --git a/apps/contourclock/fonts/Nunito-p2.png b/apps/contourclock/fonts/Nunito-p2.png new file mode 100644 index 000000000..4312d15ec Binary files /dev/null and b/apps/contourclock/fonts/Nunito-p2.png differ diff --git a/apps/contourclock/fonts/OpenSansEC-p1.png b/apps/contourclock/fonts/OpenSansEC-p1.png new file mode 100644 index 000000000..c5fe85494 Binary files /dev/null and b/apps/contourclock/fonts/OpenSansEC-p1.png differ diff --git a/apps/contourclock/fonts/OpenSansEC-p2.png b/apps/contourclock/fonts/OpenSansEC-p2.png new file mode 100644 index 000000000..f1d6381f2 Binary files /dev/null and b/apps/contourclock/fonts/OpenSansEC-p2.png differ diff --git a/apps/contourclock/fonts/Phosphate-p1.png b/apps/contourclock/fonts/Phosphate-p1.png new file mode 100644 index 000000000..2d0786c0a Binary files /dev/null and b/apps/contourclock/fonts/Phosphate-p1.png differ diff --git a/apps/contourclock/fonts/Phosphate-p2.png b/apps/contourclock/fonts/Phosphate-p2.png new file mode 100644 index 000000000..af11fea32 Binary files /dev/null and b/apps/contourclock/fonts/Phosphate-p2.png differ diff --git a/apps/contourclock/fonts/Quicksand-p1.png b/apps/contourclock/fonts/Quicksand-p1.png new file mode 100644 index 000000000..692fb9253 Binary files /dev/null and b/apps/contourclock/fonts/Quicksand-p1.png differ diff --git a/apps/contourclock/fonts/Quicksand-p2.png b/apps/contourclock/fonts/Quicksand-p2.png new file mode 100644 index 000000000..00ac7aef4 Binary files /dev/null and b/apps/contourclock/fonts/Quicksand-p2.png differ diff --git a/apps/contourclock/fonts/SairaEC-p1.png b/apps/contourclock/fonts/SairaEC-p1.png new file mode 100644 index 000000000..82b43af02 Binary files /dev/null and b/apps/contourclock/fonts/SairaEC-p1.png differ diff --git a/apps/contourclock/fonts/SairaEC-p2.png b/apps/contourclock/fonts/SairaEC-p2.png new file mode 100644 index 000000000..d32fd51b4 Binary files /dev/null and b/apps/contourclock/fonts/SairaEC-p2.png differ diff --git a/apps/contourclock/fonts/Teko-p1.png b/apps/contourclock/fonts/Teko-p1.png new file mode 100644 index 000000000..6c33087f9 Binary files /dev/null and b/apps/contourclock/fonts/Teko-p1.png differ diff --git a/apps/contourclock/fonts/Teko-p2.png b/apps/contourclock/fonts/Teko-p2.png new file mode 100644 index 000000000..8dcd86d43 Binary files /dev/null and b/apps/contourclock/fonts/Teko-p2.png differ diff --git a/apps/contourclock/fonts/Yumaro-p1.png b/apps/contourclock/fonts/Yumaro-p1.png new file mode 100644 index 000000000..5e99dd668 Binary files /dev/null and b/apps/contourclock/fonts/Yumaro-p1.png differ diff --git a/apps/contourclock/fonts/Yumaro-p2.png b/apps/contourclock/fonts/Yumaro-p2.png new file mode 100644 index 000000000..ac72818f5 Binary files /dev/null and b/apps/contourclock/fonts/Yumaro-p2.png differ diff --git a/apps/contourclock/fonts/YuseiMagic-p1.png b/apps/contourclock/fonts/YuseiMagic-p1.png new file mode 100644 index 000000000..27485a658 Binary files /dev/null and b/apps/contourclock/fonts/YuseiMagic-p1.png differ diff --git a/apps/contourclock/fonts/YuseiMagic-p2.png b/apps/contourclock/fonts/YuseiMagic-p2.png new file mode 100644 index 000000000..5b01ea036 Binary files /dev/null and b/apps/contourclock/fonts/YuseiMagic-p2.png differ diff --git a/apps/contourclock/fonts/temp b/apps/contourclock/fonts/temp new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/apps/contourclock/fonts/temp @@ -0,0 +1 @@ + diff --git a/apps/contourclock/metadata.json b/apps/contourclock/metadata.json index 9b9238703..a5d764f2d 100644 --- a/apps/contourclock/metadata.json +++ b/apps/contourclock/metadata.json @@ -1,13 +1,12 @@ { "id": "contourclock", "name": "Contour Clock", "shortName" : "Contour Clock", - "version":"0.23", + "version":"0.24", "icon": "app.png", "description": "A Minimalist clockface with large Digits. Now with more fonts!", "screenshots" : [{"url":"cc-screenshot-1.png"},{"url":"cc-screenshot-2.png"}], "tags": "clock", "custom": "custom.html", - "allow_emulator":true, "supports" : ["BANGLEJS2"], "type": "clock", "storage": [ diff --git a/apps/dtlaunch/ChangeLog b/apps/dtlaunch/ChangeLog index 62a0cab9f..556472eaa 100644 --- a/apps/dtlaunch/ChangeLog +++ b/apps/dtlaunch/ChangeLog @@ -5,3 +5,4 @@ 0.05: add Bangle 2 version 0.06: Adds settings page (hide clocks or launchers) 0.07: Adds setting for directly launching app on touch for Bangle 2 +0.08: Optimize line wrapping for Bangle 2 diff --git a/apps/dtlaunch/app-b2.js b/apps/dtlaunch/app-b2.js index 800ec456c..96e562add 100644 --- a/apps/dtlaunch/app-b2.js +++ b/apps/dtlaunch/app-b2.js @@ -45,11 +45,23 @@ function draw_icon(p,n,selected) { g.setColor(g.theme.fg); try{g.drawImage(apps[p*4+n].icon,x+12,y+4);} catch(e){} g.setFontAlign(0,-1,0).setFont("6x8",1); - var txt = apps[p*4+n].name.split(" "); - for (var i = 0; i < txt.length; i++) { - txt[i] = txt[i].trim(); - g.drawString(txt[i],x+36,y+54+i*8); + var txt = apps[p*4+n].name.replace(/([a-z])([A-Z])/g, "$1 $2").split(" "); + var lineY = 0; + var line = ""; + while (txt.length > 0){ + var c = txt.shift(); + + if (c.length + 1 + line.length > 13){ + if (line.length > 0){ + g.drawString(line.trim(),x+36,y+54+lineY*8); + lineY++; + } + line = c; + } else { + line += " " + c; + } } + g.drawString(line.trim(),x+36,y+54+lineY*8); } function drawPage(p){ diff --git a/apps/dtlaunch/metadata.json b/apps/dtlaunch/metadata.json index 8ff5bd592..6cd1dbe73 100644 --- a/apps/dtlaunch/metadata.json +++ b/apps/dtlaunch/metadata.json @@ -1,7 +1,7 @@ { "id": "dtlaunch", "name": "Desktop Launcher", - "version": "0.07", + "version": "0.08", "description": "Desktop style App Launcher with six (four for Bangle 2) apps per page - fast access if you have lots of apps installed.", "screenshots": [{"url":"shot1.png"},{"url":"shot2.png"},{"url":"shot3.png"}], "icon": "icon.png", diff --git a/apps/gpssetup/README.md b/apps/gpssetup/README.md index 8e64c6a30..8c9445ec9 100644 --- a/apps/gpssetup/README.md +++ b/apps/gpssetup/README.md @@ -107,3 +107,8 @@ try { * Some useful code on Github can be found [here](https://portal.u-blox.com/s/question/0D52p0000925T00CAE/ublox-max-m8q-getting-stuck-when-sleeping-with-extint-pin-control) and [here](https://github.com/thasti/utrak/blob/master/gps.c) + + +Written by: [Hugh Barney, with support from Gordon Williams](https://github.com/hughbarney) For support +and discussion please post in the [Bangle JS +Forum](http://forum.espruino.com/microcosms/1424/) diff --git a/apps/kitchen/README.md b/apps/kitchen/README.md index 2a1b148fd..102881d15 100644 --- a/apps/kitchen/README.md +++ b/apps/kitchen/README.md @@ -280,3 +280,8 @@ The following error codes will be displayed if one of the dependancies is not me * Add a small graph to the heart rate monitor app * Add a facility to call the Arrow calibration process * Maybe create waypoints.json file if missing + + +Written by: [Hugh Barney](https://github.com/hughbarney) For support +and discussion please post in the [Bangle JS +Forum](http://forum.espruino.com/microcosms/1424/) diff --git a/apps/lcars/ChangeLog b/apps/lcars/ChangeLog index a8c55f8fd..7d8fecb1e 100644 --- a/apps/lcars/ChangeLog +++ b/apps/lcars/ChangeLog @@ -14,4 +14,5 @@ 0.14: Added altitude as an option to display. 0.15: Using wpedom to count steps. 0.16: Improved stability. Wind can now be shown. -0.17: Settings for mph/kph and other minor improvements. \ No newline at end of file +0.17: Settings for mph/kph and other minor improvements. +0.18: Fullscreen mode can now be enabled or disabled in the settings. \ No newline at end of file diff --git a/apps/lcars/README.md b/apps/lcars/README.md index b6bfda2c1..f979b2304 100644 --- a/apps/lcars/README.md +++ b/apps/lcars/README.md @@ -11,7 +11,7 @@ with Gadgetbride and the weather app must be installed. ## Features * LCARS Style watch face. - * Full screen mode - widgets are still loaded but not shown. + * Enable or disable fullscreen mode (widgets are always loaded, but hidden if fullscreen). * Tab on left/right to switch between different screens. * Cusomizable data that is shown on screen 1 (steps, weather etc.) * Shows random and real images of planets. @@ -33,7 +33,7 @@ with Gadgetbride and the weather app must be installed. ## Multiple screens support Access different screens via tap on the left/ right side of the screen -![](screenshot.png) +![](screenshot_1.png) ![](screenshot_2.png) diff --git a/apps/lcars/bg_left_small.png b/apps/lcars/bg_left_small.png new file mode 100644 index 000000000..bfdb110d9 Binary files /dev/null and b/apps/lcars/bg_left_small.png differ diff --git a/apps/lcars/bg_right_small.png b/apps/lcars/bg_right_small.png new file mode 100644 index 000000000..df9d32b38 Binary files /dev/null and b/apps/lcars/bg_right_small.png differ diff --git a/apps/lcars/lcars.app.js b/apps/lcars/lcars.app.js index dcbd294bb..7d5da2d8e 100644 --- a/apps/lcars/lcars.app.js +++ b/apps/lcars/lcars.app.js @@ -7,6 +7,7 @@ let settings = { dataRow2: "Temp", dataRow3: "Battery", speed: "kph", + fullscreen: false, }; let saved_settings = storage.readJSON(SETTINGS_FILE, 1) || settings; for (const key in saved_settings) { @@ -30,23 +31,39 @@ let lcarsViewPos = 0; // let hrmValue = 0; var plotMonth = false; + /* * Requirements and globals */ -var bgLeft = { +var bgLeftFullscreen = { width : 27, height : 176, bpp : 3, transparent : 0, buffer : require("heatshrink").decompress(atob("AAUM2XLlgCCwAJBBAuy4EAmQIF5cggAIGlmwgYIG2XIF42wF4ImGF4ImHJoQmGJoQdJhZNHNY47CgRNGBIJZHHgRiGBIRQ/KH5QCAFCh/eX5Q/KAwdCAGVbtu27YCCoAJBkuWrNlAQRGCiwRDAQPQBIMJCIYCBsAJBgomEtu0WoQmEy1YBIMBHYttIwQ7FyxQ/KHFlFAQ7F2weCHYplKChRTCCg5TCHw5TMAD0GzVp0wCCBBGaBIMaBAtpwECBA2mwEJBAugDgMmCIwJBF5EABAtoeQQvGCYQdPJoI7LMQzTCLJKAGzAJBO4xQ/KGQA8UP7y/KH5QnAHih/eX5Q/GQ4JCGRJlKCgxTDBAwgCCg5TCHwxTCNA4A==")) }; -var bgRight = { +var bgLeftNotFullscreen = { + width : 27, height : 152, bpp : 3, + transparent : 0, + buffer : require("heatshrink").decompress(atob("AAUM2XLlgCCwAJBBAuy4EAmQIF5cggAIGlmwgYIG2XIF42wF4ImGF4ImHJoQmGJoQdJhZNHNY47CgRNGBIJZHHgRiGBIRQ/KH5QCAGVbtu27YCCoAJBkuWrNlAQRkCiwRDAQPQBIMJCIYCBsAJBgomEtu0WoQmEy1YBIMBHYttIwQ7FyxQ/KHFlFAQ7F2weCHYplKChRTCCg5TCHw5TMAD0GzVp0wCCBBGaBIMaBAtpwECBA2mwEJBAugDgMmCIwJBF5EABAtoeQQvGCYQdPJoI7LMQzTCLJKAGzAJBO4xQ/KGQA8UP7y/KH5QnAHih/eX5Q/GQ4JCGRJlKCgxTDBAwgCCg5TCHwxTCNA4A=")) +}; + +var bgRightFullscreen = { width : 27, height : 176, bpp : 3, transparent : 0, buffer : require("heatshrink").decompress(atob("lmy5YCDBIUyBAmy5AJBhYUG2EAhgIFAQMAgQIGCgQABCg4ABEAwUNFI2AKZHAKZEgGRZTGOIUDQxJxGKH5Q/agwAnUP7y/KH4yGeVYAJrdt23bAQVABIMly1ZsoCCMgUWCIYCB6AJBhIRDAQNgBIMFEwlt2i1CEwmWrAJBgI7FtpGCHYuWKH5QxEwpQDlo7F0A7IqBZBEwo7BCIwCBJo53CJoxiCJpIAdgOmzVpAQR/CgAIEAQJ2CBAoCBBIMmCg1oD4QLGFQUCCjQ+CKYw+CKY4JCKYwoCGRMaGREJDoroCgwdFzBlLKH5QvAHih/eX5Q/KE4A8UP7y/KH5QGDpg7HJoxZCCIx3CJowmCF4yACJox/CgAA=")) }; +var bgRightNotFullscreen = { + width : 27, height : 152, bpp : 3, + transparent : 0, + buffer : require("heatshrink").decompress(atob("lmy5YCDBIUyBAmy5AJBhYUG2EAhgIFAQMAgQIGCgQABCg4ABEAwUNFI2AKZHAKZEgGRZTGOIUDQxJxGKH5Q/agwAxrdt23bAQVABIMly1ZsoCCMgUWCIYCB6AJBhIRDAQNgBIMFEwlt2i1CEwmWrAJBgI7FtpGCHYuWKH5QxEwpQDlo7F0A7IqBZBEwo7BCIwCBJo53CJoxiCJpIAdgOmzVpAQR/CgAIEAQJ2CBAoCBBIMmCg1oD4QLGFQUCCjQ+CKYw+CKY4JCKYwoCGRMaGREJDoroCgwdFzBlLKH5QvAHih/eX5Q/KE4A8UP7y/KH5QGDpg7HJoxZCCIx3CJowmCF4yACJox/CgA=")) +}; + +var bgLeft = settings.fullscreen ? bgLeftFullscreen : bgLeftNotFullscreen; +var bgRight= settings.fullscreen ? bgRightFullscreen : bgRightNotFullscreen; + var iconEarth = { width : 50, height : 50, bpp : 3, buffer : require("heatshrink").decompress(atob("AFtx48ECBsDwU5k/yhARLjgjBjlzAQMQEZcIkOP/fn31IEZgCBnlz58cEpM4geugEgwU/8+WNZJHDuHHvgmBCQ8goEOnVgJoMnyV58mACItHI4X8uAFBuVHnnz4BuGxk4////Egz3IkmWvPgNw8f/prB//BghTC+AjE7848eMjNnzySBwUJkmf/BuGuPDAQIjBiPHhhTCSQnjMo0ITANJn44Dg8MuFBggCCiFBcAJ0Bv5xEh+ITo2OhHkyf/OIQdBWwVHhgjBNwUE+fP/5EEgePMoYLBhMgyVJk/+BQQdC688I4XxOIc8v//NAvr+QEBj/5NwKVBy1/QYUciPBhk1EAJrC+KeC489QYaMBgU/8BNB9+ChEjz1Jkn/QYMBDQIgCcYTCCiP/nlzJQmenMAgV4//uy/9wRaB/1J8iVCcAfHjt9TYYICnhKCgRKBw159/v//r927OIeeoASBDQccvv3791KYVDBYPLJQeCnPnz//AAP6ocEjEkXgMgJQtz79fLAP8KYkccAcJ8Gf/f/xu/cAMQ4eP5MlyQRCMolx40YsOGBAPfnnzU4KVDpKMBvz8Dh0/8me7IICgkxJQXPIgZTD58sEgcJk+eNoONnFBhk4/5uB/pcDg5KD+4mEv4CBXISVDhEn31/8/+mH7x//JQK5CAAMB4JBCnnxJQf/+fJEgkAa4L+CAQOOjMn/1bXIRxDJQXx58f//Hhlz/88EgsChMgz/Zs/+nfkyV/8huDOI6SD498NwoACi1Z8+S/Plz17/+QCI7jC+ZxBmfPnojIAAMDcYWSp//2wRJEwq2GABECjMgNYwAmA=")) @@ -217,7 +234,7 @@ function drawHorizontalBgLine(color, x1, x2, y, h){ function drawInfo(){ - if(lcarsViewPos != 0){ + if(lcarsViewPos != 0 || !settings.fullscreen){ return; } @@ -276,9 +293,10 @@ function drawState(){ function drawPosition0(){ // Draw background image - g.drawImage(bgLeft, 0, 0); - drawHorizontalBgLine(cBlue, 25, 120, 0, 4); - drawHorizontalBgLine(cBlue, 130, 176, 0, 4); + var offset = settings.fullscreen ? 0 : 24; + g.drawImage(bgLeft, 0, offset); + drawHorizontalBgLine(cBlue, 25, 120, offset, 4); + drawHorizontalBgLine(cBlue, 130, 176, offset, 4); drawHorizontalBgLine(cPurple, 20, 70, 80, 4); drawHorizontalBgLine(cPurple, 80, 176, 80, 4); drawHorizontalBgLine(cOrange, 35, 110, 87, 4); @@ -304,15 +322,26 @@ function drawPosition0(){ var currentDate = new Date(); var timeStr = locale.time(currentDate,1); g.setFontAntonioLarge(); - g.drawString(timeStr, 27, 10); + if(settings.fullscreen){ + g.drawString(timeStr, 27, 10); + } else { + g.drawString(timeStr, 27, 33); + } // Write date g.setColor(cWhite); g.setFontAntonioMedium(); - var dayStr = locale.dow(currentDate, true).toUpperCase(); - dayStr += " " + currentDate.getDate(); - dayStr += " " + locale.month(currentDate, 1).toUpperCase(); - g.drawString(dayStr, 30, 56); + if(settings.fullscreen){ + var dayStr = locale.dow(currentDate, true).toUpperCase(); + dayStr += " " + currentDate.getDate(); + dayStr += " " + locale.month(currentDate, 1).toUpperCase(); + g.drawString(dayStr, 30, 56); + } else { + var dayStr = locale.dow(currentDate, true).toUpperCase(); + var date = currentDate.getDate(); + g.drawString(dayStr, 128, 35); + g.drawString(date, 128, 55); + } // Draw data g.setFontAlign(-1, -1, 0); @@ -327,8 +356,11 @@ function drawPosition0(){ function drawPosition1(){ // Draw background image - g.drawImage(bgRight, 149, 0); - drawHorizontalBgLine(cBlue, 0, 140, 0, 4); + var offset = settings.fullscreen ? 0 : 24; + g.drawImage(bgRight, 149, offset); + if(settings.fullscreen){ + drawHorizontalBgLine(cBlue, 0, 140, offset, 4); + } drawHorizontalBgLine(cPurple, 0, 80, 80, 4); drawHorizontalBgLine(cPurple, 90, 150, 80, 4); drawHorizontalBgLine(cOrange, 0, 50, 87, 4); @@ -388,8 +420,13 @@ function drawPosition1(){ g.setFontAlign(1, 1, 0); g.setFontAntonioMedium(); g.setColor(cWhite); - g.drawString("M-HRM", 154, 27); - g.drawString("M-STEPS [K]", 154, 115); + + if(settings.fullscreen){ + g.drawString("M-HRM", 154, 27); + g.drawString("M-STEPS [K]", 154, 115); + } else { + g.drawString("MONTH", 154, 115); + } // Plot day } else { @@ -429,8 +466,13 @@ function drawPosition1(){ g.setFontAlign(1, 1, 0); g.setFontAntonioMedium(); g.setColor(cWhite); - g.drawString("D-HRM", 154, 27); - g.drawString("D-STEPS", 154, 115); + + if(settings.fullscreen){ + g.drawString("D-HRM", 154, 27); + g.drawString("D-STEPS", 154, 115); + } else { + g.drawString("DAY", 154, 115); + } } } @@ -451,6 +493,13 @@ function draw(){ } else if (lcarsViewPos == 1) { drawPosition1(); } + + // After drawing the watch face, we can draw the widgets + if(settings.fullscreen){ + for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} + } else { + Bangle.drawWidgets(); + } } @@ -501,8 +550,9 @@ function getWeather(){ weather.hum = weather.hum + "%"; // Wind - var speedFactor = settings.speed == "kph" ? 1.60934 : 1.0; - weather.wind = Math.round(weather.wind * speedFactor); + const wind = locale.speed(weather.wind).match(/^(\D*\d*)(.*)$/); + var speedFactor = settings.speed == "kph" ? 1.0 : 1.0 / 1.60934; + weather.wind = Math.round(wind[1] * speedFactor); return weather } @@ -652,16 +702,7 @@ Bangle.on('touch', function(btn, e){ // Show launcher when middle button pressed Bangle.setUI("clock"); 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 and change the - * area to the top bar doesn't get cleared. - */ -for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} // Clear the screen once, at startup and draw clock g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear(); draw(); - -// After drawing the watch face, we can draw the widgets -// Bangle.drawWidgets(); diff --git a/apps/lcars/lcars.settings.js b/apps/lcars/lcars.settings.js index 176f88593..75add1ece 100644 --- a/apps/lcars/lcars.settings.js +++ b/apps/lcars/lcars.settings.js @@ -9,6 +9,7 @@ dataRow2: "Steps", dataRow3: "Temp", speed: "kph", + fullscreen: false, }; let saved_settings = storage.readJSON(SETTINGS_FILE, 1) || settings; for (const key in saved_settings) { @@ -52,6 +53,14 @@ save(); }, }, + 'Full Screen': { + value: settings.fullscreen, + format: () => (settings.fullscreen ? 'Yes' : 'No'), + onchange: () => { + settings.fullscreen = !settings.fullscreen; + save(); + }, + }, 'Speed': { value: 0 | speedOptions.indexOf(settings.speed), min: 0, max: 1, diff --git a/apps/lcars/metadata.json b/apps/lcars/metadata.json index a402b35a4..e6ca10f79 100644 --- a/apps/lcars/metadata.json +++ b/apps/lcars/metadata.json @@ -3,13 +3,15 @@ "name": "LCARS Clock", "shortName":"LCARS", "icon": "lcars.png", - "version":"0.17", + "version":"0.18", "readme": "README.md", "supports": ["BANGLEJS2"], "description": "Library Computer Access Retrieval System (LCARS) clock.", "type": "clock", "tags": "clock", - "screenshots": [{"url":"screenshot.png"}], + "screenshots": [ + {"url":"screenshot_1.png"}, + {"url":"screenshot_3.png"}], "storage": [ {"name":"lcars.app.js","url":"lcars.app.js"}, {"name":"lcars.img","url":"lcars.icon.js","evaluate":true}, diff --git a/apps/lcars/screenshot.png b/apps/lcars/screenshot.png deleted file mode 100644 index e2d2cbd5f..000000000 Binary files a/apps/lcars/screenshot.png and /dev/null differ diff --git a/apps/lcars/screenshot_1.png b/apps/lcars/screenshot_1.png new file mode 100644 index 000000000..09a604069 Binary files /dev/null and b/apps/lcars/screenshot_1.png differ diff --git a/apps/lcars/screenshot_2.png b/apps/lcars/screenshot_2.png index 52ad295c4..a7a94db39 100644 Binary files a/apps/lcars/screenshot_2.png and b/apps/lcars/screenshot_2.png differ diff --git a/apps/lcars/screenshot_3.png b/apps/lcars/screenshot_3.png new file mode 100644 index 000000000..931ea15de Binary files /dev/null and b/apps/lcars/screenshot_3.png differ diff --git a/apps/mylocation/ChangeLog b/apps/mylocation/ChangeLog index 653f859ae..b9eba67f4 100644 --- a/apps/mylocation/ChangeLog +++ b/apps/mylocation/ChangeLog @@ -1,2 +1,3 @@ 0.01: First release 0.02: Enhanced icon, make it bolder +0.03: Fixed issue with defaulting back to London diff --git a/apps/mylocation/metadata.json b/apps/mylocation/metadata.json index b26a97290..a7fd8356c 100644 --- a/apps/mylocation/metadata.json +++ b/apps/mylocation/metadata.json @@ -4,7 +4,7 @@ "icon": "mylocation.png", "type": "app", "screenshots": [{"url":"screenshot_1.png"}], - "version":"0.02", + "version":"0.03", "description": "Sets and stores the lat and long of your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", "readme": "README.md", "tags": "tool,utility", diff --git a/apps/mylocation/mylocation.app.js b/apps/mylocation/mylocation.app.js index fb2f73fa7..27ab17ea5 100644 --- a/apps/mylocation/mylocation.app.js +++ b/apps/mylocation/mylocation.app.js @@ -9,32 +9,35 @@ let s = { 'lat': 51.5072, 'lon': 0.1276, 'location': "London" -} +}; function loadSettings() { - settings = require('Storage').readJSON(SETTINGS_FILE, 1) || s; + settings = require('Storage').readJSON(SETTINGS_FILE, 1) || {}; + for (const key in settings) { + s[key] = settings[key] + } } function save() { - settings = s - require('Storage').write(SETTINGS_FILE, settings) + settings = s; + require('Storage').write(SETTINGS_FILE, settings); } -const locations = ["London", "Newcastle", "Edinburgh", "Paris", "New York", "Tokyo","???"]; -const lats = [51.5072 ,54.9783 ,55.9533 ,48.8566 ,40.7128 ,35.6762, 0.0]; -const lons = [-0.1276 ,-1.6178 ,-3.1883 ,2.3522 , -74.0060 ,139.6503, 0.0]; +const locations = ["London" ,"Newcastle","Edinburgh", "Paris" , "New York" , "Tokyo" , "Frankfurt", "Auckland", "???"]; +const lats = [ 51.5072 , 54.9783 , 55.9533 , 48.8566 , 40.7128 , 35.6762 , 50.1236 , -36.9 , 0.0 ]; +const lons = [ -0.1276 , -1.6178 , -3.1883 , 2.3522 , -74.0060 , 139.6503 , 8.6553 , 174.7832 , 0.0 ]; function setFromGPS() { Bangle.on('GPS', (gps) => { //console.log("."); if (gps.fix === 0) return; //console.log("fix from GPS"); - s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' } + s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' }; Bangle.buzz(1500); // buzz on first position Bangle.setGPSPower(0); save(); - Bangle.setUI("updown", ()=>{ load() }); + Bangle.setUI("updown", ()=>{ load(); }); E.showPrompt("Location has been saved from the GPS fix",{ title:"Location Saved", buttons : {"OK":1} @@ -49,13 +52,13 @@ function setFromGPS() { } function showMainMenu() { - console.log("showMainMenu"); + //console.log("showMainMenu"); const mainmenu = { '': { 'title': 'My Location' }, '{ load(); }, 'City': { value: 0 | locations.indexOf(s.location), - min: 0, max: 6, + min: 0, max: locations.length - 1, format: v => locations[v], onchange: v => { if (v != 6) { @@ -67,7 +70,7 @@ function showMainMenu() { } }, 'Set From GPS': ()=>{ setFromGPS(); } - } + }; return E.showMenu(mainmenu); } diff --git a/apps/pastel/ChangeLog b/apps/pastel/ChangeLog index 570c37507..d133697b3 100644 --- a/apps/pastel/ChangeLog +++ b/apps/pastel/ChangeLog @@ -13,3 +13,6 @@ which requires 2.11.27 firmware to reset at midnight 0.13: call process.memory(false) to avoid triggering a GC of memory supported in pre 2.12.13 firmware +0.14: incorporated lazybones idle timer, configuration settings to come +0.15: fixed tendancy for mylocation to default to London + added setting to enable/disable idle timer warning diff --git a/apps/pastel/metadata.json b/apps/pastel/metadata.json index 0a04491fc..da3c18eae 100644 --- a/apps/pastel/metadata.json +++ b/apps/pastel/metadata.json @@ -2,8 +2,8 @@ "id": "pastel", "name": "Pastel Clock", "shortName": "Pastel", - "version": "0.13", - "description": "A Configurable clock with custom fonts, background and weather display. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times.", + "version": "0.15", + "description": "A Configurable clock with custom fonts, background and weather display. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", "icon": "pastel.png", "dependencies": {"mylocation":"app","weather":"app"}, "screenshots": [{"url":"screenshot_pastel.png"}, {"url":"weather_icons.png"}], diff --git a/apps/pastel/pastel.app.js b/apps/pastel/pastel.app.js index 5def5737c..605b78ad0 100644 --- a/apps/pastel/pastel.app.js +++ b/apps/pastel/pastel.app.js @@ -4,9 +4,18 @@ const storage = require('Storage'); const locale = require("locale"); const SETTINGS_FILE = "pastel.json"; const LOCATION_FILE = "mylocation.json"; +const w = g.getWidth(); +const h = g.getHeight(); let settings; let location; +// variable for controlling idle alert +let lastStep = getTime(); +let lastStepTime = '??'; +let warned = 0; +let idle = false; +let IDLE_MINUTES = 26; + // cloud, sun, partSun, snow, rain, storm, error // create 1 bit, max contrast, brightness set to 85 var cloudIcon = require("heatshrink").decompress(atob("kEggIfcj+AAYM/8ADBuFwAYPAmADCCAMBwEf8ADBhFwg4aBnEPAYMYjAVBhgDDDoQDHCYc4jwDB+EP///FYIDBMTgA==")); @@ -16,16 +25,24 @@ var snowIcon = require("heatshrink").decompress(atob("kEggITQj/AAYM98ADBsEwAYPAj var rainIcon = require("heatshrink").decompress(atob("kEggIPMh+AAYM/8ADBuFwAYPgmADB4EbAYOAj/ggOAhnwg4aBnAeCjEcCIMMjADCDoQDHjAPCnAXCuEP///8EDAYJECAAXBwkAgPDhwDBwUMgEEhkggEOjFgFgMQLYQAOA==")); var errIcon = require("heatshrink").decompress(atob("kEggILIgOAAYsD4ADBg/gAYMGsADBhkwAYsYjADCjgDBmEMAYNxxwDBsOGAYPBwYDEgOBwOAgYDB4EDHYPAgwDBsADDhgDBFIcwjAHBjE4AYMcmADBhhNCKIcG/4AGOw4A==")); +// saves having to recode all the small font calls +function setSmallFont() { + g.setFontLatoSmall(); +} function loadSettings() { settings = require("Storage").readJSON(SETTINGS_FILE,1)||{}; settings.grid = settings.grid||false; settings.font = settings.font||"Lato"; + settings.idle_check = settings.idle_check||true; } // requires the myLocation app function loadLocation() { - location = require("Storage").readJSON(LOCATION_FILE,1)||{"lat":51.5072,"lon":0.1276,"location":"London"}; + location = require("Storage").readJSON(LOCATION_FILE,1)||{}; + location.lat = location.lat||51.5072; + location.lon = location.lon||0.1276; + location.location = location.location||"London"; } function extractTime(d){ @@ -71,17 +88,18 @@ function getSteps() { if (WIDGETS.wpedom !== undefined) return WIDGETS.wpedom.getSteps(); else - return '???' + return '???'; } } const infoData = { ID_BLANK: { calc: () => '' }, - ID_DATE: { calc: () => {var d = (new Date).toString().split(" "); return d[2] + ' ' + d[1] + ' ' + d[3];} }, - ID_DAY: { calc: () => {var d = require("locale").dow(new Date).toLowerCase(); return d[0].toUpperCase() + d.substring(1);} }, + ID_DATE: { calc: () => {var d = (new Date()).toString().split(" "); return d[2] + ' ' + d[1] + ' ' + d[3];} }, + ID_DAY: { calc: () => {var d = require("locale").dow(new Date()).toLowerCase(); return d[0].toUpperCase() + d.substring(1);} }, ID_SR: { calc: () => 'Sunrise: ' + sunRise }, ID_SS: { calc: () => 'Sunset: ' + sunSet }, ID_STEP: { calc: () => 'Steps: ' + getSteps() }, + ID_LAST: { calc: () => 'Last Step: ' + lastStepTime }, ID_BATT: { calc: () => 'Battery: ' + E.getBattery() + '%' }, ID_MEM: { calc: () => {var val = process.memory(false); return 'Ram: ' + Math.round(val.usage*100/val.total) + '%';} }, ID_ID: { calc: () => {var val = NRF.getAddress().split(':'); return 'Id: ' + val[4] + val[5];} }, @@ -152,6 +170,14 @@ function getWeather() { } function draw() { + if (!idle) + drawClock(); + else + drawIdle(); + queueDraw(); +} + +function drawClock() { var d = new Date(); var da = d.toString().split(" "); var time = da[4].substr(0,5); @@ -166,11 +192,8 @@ function draw() { if (parseInt(hh) > 12) hh = h2.substr(h2.length -2); - var w = g.getWidth(); - var h = g.getHeight(); var x = (g.getWidth()/2); var y = (g.getHeight()/3); - var weatherJson = getWeather(); var w_temp; var w_icon; @@ -190,7 +213,8 @@ function draw() { } g.reset(); - g.clearRect(0, 30, w, h - 24); + g.setColor(g.theme.bg); + g.fillRect(Bangle.appRect); // draw a grid like graph paper if (settings.grid && process.env.HWVERSION !=1) { @@ -249,6 +273,141 @@ function draw() { queueDraw(); } + +///////////////// IDLE TIMER ///////////////////////////////////// + +function log_debug(o) { + //print(o); +} + +function drawIdle() { + let mins = Math.round((getTime() - lastStep) / 60); + g.reset(); + g.setColor(g.theme.bg); + g.fillRect(Bangle.appRect); + g.setColor(g.theme.fg); + setSmallFont(); + g.setFontAlign(0, 0); + g.drawString('Last step was', w/2, (h/3)); + g.drawString(mins + ' minutes ago', w/2, 20+(h/3)); + dismissBtn.draw(); +} + +/////////////// BUTTON CLASS /////////////////////////////////////////// + +// simple on screen button class +function BUTTON(name,x,y,w,h,c,f,tx) { + this.name = name; + this.x = x; + this.y = y; + this.w = w; + this.h = h; + this.color = c; + this.callback = f; + this.text = tx; +} + +// if pressed the callback +BUTTON.prototype.check = function(x,y) { + //console.log(this.name + ":check() x=" + x + " y=" + y +"\n"); + + if (x>= this.x && x<= (this.x + this.w) && y>= this.y && y<= (this.y + this.h)) { + log_debug(this.name + ":callback\n"); + this.callback(); + return true; + } + return false; +}; + +BUTTON.prototype.draw = function() { + g.setColor(this.color); + g.fillRect(this.x, this.y, this.x + this.w, this.y + this.h); + g.setColor("#000"); // the icons and boxes are drawn black + setSmallFont(); + g.setFontAlign(0, 0); + g.drawString(this.text, (this.x + this.w/2), (this.y + this.h/2)); + g.drawRect(this.x, this.y, (this.x + this.w), (this.y + this.h)); +}; + +function dismissPrompt() { + idle = false; + warned = false; + lastStep = getTime(); + Bangle.buzz(100); + draw(); +} + +var dismissBtn = new BUTTON("big",0, 3*h/4 ,w, h/4, "#0ff", dismissPrompt, "Dismiss"); + +Bangle.on('touch', function(button, xy) { + if (idle && dismissBtn.check(xy.x, xy.y)) return; +}); + +// if we get a step then we are not idle +Bangle.on('step', s => { + setLastStepTime(); + lastStep = getTime(); + // redraw if we had been idle + if (idle == true) { + dismissPrompt(); + } + idle = false; + warned = 0; +}); + +function setLastStepTime() { + var date = new Date(); + lastStepTime = require("locale").time(date,1); +} + +function checkIdle() { + if (!settings.idle_check) { + idle = false; + warned = false; + return; + } + + let hour = (new Date()).getHours(); + let active = (hour >= 9 && hour < 21); + //let active = true; + let dur = getTime() - lastStep; + + if (active && dur > IDLE_MINUTES * 60) { + drawIdle(); + if (warned++ < 3) { + buzzer(warned); + log_debug("checkIdle: warned=" + warned); + Bangle.setLocked(false); + } + idle = true; + } else { + idle = false; + warned = 0; + } +} + +setLastStepTime(); + +// timeout for multi-buzzer +var buzzTimeout; + +// n buzzes +function buzzer(n) { + log_debug("buzzer n=" + n); + + if (n-- < 1) return; + Bangle.buzz(250); + + if (buzzTimeout) clearTimeout(buzzTimeout); + buzzTimeout = setTimeout(function() { + buzzTimeout = undefined; + buzzer(n); + }, 500); +} + + +/////////////////////////////////////////////////////////////////////////////// + // timeout used to update every minute var drawTimeout; @@ -258,6 +417,7 @@ function queueDraw() { drawTimeout = setTimeout(function() { drawTimeout = undefined; prevInfo(); + checkIdle(); draw(); }, 60000 - (Date.now() % 60000)); } diff --git a/apps/pastel/pastel.settings.js b/apps/pastel/pastel.settings.js index bf83fa7c2..26dafd271 100644 --- a/apps/pastel/pastel.settings.js +++ b/apps/pastel/pastel.settings.js @@ -5,6 +5,7 @@ let s = { 'grid': false, 'weather': false, + 'idle_check': true, 'font': "Lato" } @@ -51,6 +52,24 @@ s.weather = !s.weather; save(); }, + }, + // for use when the new menu system goes live + /* + 'Idle Warning': { + value: s.idle_check, + onchange : v => { + s.idle_check = v; + save(); + }, + }, + */ + 'Idle Warning': { + value: s.idle_check, + format: () => (s.idle_check ? 'Yes' : 'No'), + onchange: () => { + s.idle_check = !s.idle_check; + save(); + }, } }) }) diff --git a/apps/recorder/interface.html b/apps/recorder/interface.html index 08021374d..8cf339e85 100644 --- a/apps/recorder/interface.html +++ b/apps/recorder/interface.html @@ -4,8 +4,11 @@
+
+ + - + + + + + + - - + diff --git a/core b/core index 187af1527..3093d78a5 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 187af1527e0b830c804049aae834ed658ffeed08 +Subproject commit 3093d78a5d752cbf03ea8f9a1a7c0b50b9c8123b