1
0
Fork 0

Merge pull request #1 from ZenMondo/ZenMods

Added Fahrenheit Thermometer
master
L. Christopher Bird 2021-07-22 09:43:51 -07:00 committed by GitHub
commit 0a93e27570
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View File

@ -3316,5 +3316,22 @@
{"name":"mysticclock.settings.js","url":"mystic-clock-settings.js"}, {"name":"mysticclock.settings.js","url":"mystic-clock-settings.js"},
{"name":"mysticclock.img","url":"mystic-clock-icon.js","evaluate":true} {"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}
]
} }
] ]

View File

@ -0,0 +1,2 @@
require("heatshrink").decompress(atob("AH4A/AAMIxGIwAXTxACEACIsChAXqLwQDBMCQXYI4YvUCgIXVF6xH/I8DX/R/4ANgUgAIYX/C+MiC4ciFyQCGC54aEgAXQIIUiAYYXRgUzmYtBC6ASCC4IcCC5+wgGzC4M7gELC6O7C4O7C6ISC2c7DgQXRAQIDDC58LFYIFIGB4uSFQRFDFyJeDMAYA/AH4"))
}

BIN
apps/thermomF/app..png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

28
apps/thermomF/app.js Normal file
View File

@ -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();