diff --git a/apps.json b/apps.json index cc21f3115..2148fb5f6 100644 --- a/apps.json +++ b/apps.json @@ -3316,5 +3316,22 @@ {"name":"mysticclock.settings.js","url":"mystic-clock-settings.js"}, {"name":"mysticclock.img","url":"mystic-clock-icon.js","evaluate":true} ] +}, + + +{ "id": "thermomF", + "name": "Fahrenheit Thermometer", + "shortName":"Thermometer F", + "icon": "app.png", + "version":"0.01", + "description": "A modification of the Thermometer App to display temprature in Fahrenheit", + "tags": "", + "storage": [ + {"name":"thermof.app.js","url":"app.js"}, + {"name":"thermof.png","url":"app-icon.js","evaluate":true} + ] } ] + + + diff --git a/apps/thermomF/app-icon.js b/apps/thermomF/app-icon.js new file mode 100644 index 000000000..3a5bb959f --- /dev/null +++ b/apps/thermomF/app-icon.js @@ -0,0 +1,2 @@ +require("heatshrink").decompress(atob("AH4A/AAMIxGIwAXTxACEACIsChAXqLwQDBMCQXYI4YvUCgIXVF6xH/I8DX/R/4ANgUgAIYX/C+MiC4ciFyQCGC54aEgAXQIIUiAYYXRgUzmYtBC6ASCC4IcCC5+wgGzC4M7gELC6O7C4O7C6ISC2c7DgQXRAQIDDC58LFYIFIGB4uSFQRFDFyJeDMAYA/AH4")) +} \ No newline at end of file diff --git a/apps/thermomF/app..png b/apps/thermomF/app..png new file mode 100644 index 000000000..bb33cb939 Binary files /dev/null and b/apps/thermomF/app..png differ diff --git a/apps/thermomF/app.js b/apps/thermomF/app.js new file mode 100644 index 000000000..76f15b481 --- /dev/null +++ b/apps/thermomF/app.js @@ -0,0 +1,28 @@ +function onTemperature(p) { + g.reset(1).clearRect(0,24,g.getWidth(),g.getHeight()); + g.setFont("6x8",2).setFontAlign(0,0); + var x = g.getWidth()/2; + var y = g.getHeight()/2 + 10; + g.drawString("Temperature", x, y - 45); + g.setFontVector(70).setFontAlign(0,0); + g.drawString(p.temperature.toFixed(1), x, y); +} + +function drawTemperature() { + if (Bangle.getPressure) { + Bangle.getPressure().then(onTemperature); + } else { + onTemperature({ + temperature : E.getTemperature() * (9/5) + 32, + }); + } +} + + +setInterval(function() { + drawTemperature(); +}, 20000); +drawTemperature(); +E.showMessage("Loading..."); +Bangle.loadWidgets(); +Bangle.drawWidgets(); \ No newline at end of file