diff --git a/apps.json b/apps.json index aa4d712fe..2399b53c7 100644 --- a/apps.json +++ b/apps.json @@ -3358,5 +3358,19 @@ {"name":"mysticclock.settings.js","url":"mystic-clock-settings.js"}, {"name":"mysticclock.img","url":"mystic-clock-icon.js","evaluate":true} ] +}, +{ "id": "thermomF", + "name": "Fahrenheit Temp", + "icon": "thermf.png", + "version":"0.01", + "description": "A modification of the Thermometer App to display temprature in Fahrenheit", + "tags": "tool", + "storage": [ + {"name":"thermomF.app.js","url":"app.js"}, + {"name":"thermomF.img","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..fe1fa86b7 --- /dev/null +++ b/apps/thermomF/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwhC/AH4AChGIxGAC6eIAQgARFgUIC9ReCAYJgSC7BHDF6gUBC6ovWI/5Hga/6P/ABsCkABDC/4XxkQXDkQuSAQwXPDQkAC6BBCkQDDC6MCmczFoIXQCQQXBDgQXP2EA2YXBncAhYXR3YXB3YXRCQWznYcCC6ICBAYYXPhYrBApAwPFyQqCIoYuRLwZgDAH4A/")) \ No newline at end of file diff --git a/apps/thermomF/app.js b/apps/thermomF/app.js new file mode 100644 index 000000000..2961e1efc --- /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 diff --git a/apps/thermomF/thermf.png b/apps/thermomF/thermf.png new file mode 100644 index 000000000..bb33cb939 Binary files /dev/null and b/apps/thermomF/thermf.png differ