Merge pull request #962 from myxor/myxor-temperature-app

Update degree Celsius temperature app
pull/982/head
Gordon Williams 2021-11-29 10:08:07 +00:00 committed by GitHub
commit 0d45f2c2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -3893,8 +3893,8 @@
{
"id": "thermom",
"name": "Thermometer",
"version": "0.02",
"description": "Displays the current temperature, updated every 20 seconds",
"version": "0.03",
"description": "Displays the current temperature in degree Celsius, updated every 20 seconds",
"icon": "app.png",
"tags": "tool",
"supports": ["BANGLEJS"],

View File

@ -1 +1,2 @@
0.02: New App!
0.03: Improved messages and added Celsius sign

View File

@ -3,9 +3,9 @@ function onTemperature(p) {
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.drawString("Temperature:", x, y - 45);
g.setFontVector(70).setFontAlign(0,0);
g.drawString(p.temperature.toFixed(1), x, y);
g.drawString(p.temperature.toFixed(1) + " °C", x, y);
}
function drawTemperature() {
@ -23,6 +23,6 @@ setInterval(function() {
drawTemperature();
}, 20000);
drawTemperature();
E.showMessage("Loading...");
E.showMessage("Reading temperature...");
Bangle.loadWidgets();
Bangle.drawWidgets();