Skip to content

Commit

Permalink
Merge pull request #1 from ZenMondo/ZenMods
Browse files Browse the repository at this point in the history
Added Fahrenheit Thermometer
  • Loading branch information
ZenMondo committed Jul 22, 2021
2 parents 4a01fa1 + 1d5dc85 commit 0a93e27
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]
}
]



2 changes: 2 additions & 0 deletions apps/thermomF/app-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added apps/thermomF/app..png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions apps/thermomF/app.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 0a93e27

Please sign in to comment.