Merge pull request #779 from ZenMondo/master
Added Fahrenheit Thermometer (please disregard last pull request)master
commit
73b1cfde88
14
apps.json
14
apps.json
|
|
@ -3358,5 +3358,19 @@
|
||||||
{"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 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}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
require("heatshrink").decompress(atob("mEwwhC/AH4AChGIxGAC6eIAQgARFgUIC9ReCAYJgSC7BHDF6gUBC6ovWI/5Hga/6P/ABsCkABDC/4XxkQXDkQuSAQwXPDQkAC6BBCkQDDC6MCmczFoIXQCQQXBDgQXP2EA2YXBncAhYXR3YXB3YXRCQWznYcCC6ICBAYYXPhYrBApAwPFyQqCIoYuRLwZgDAH4A/"))
|
||||||
|
|
@ -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();
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue