Merge pull request #2093 from thyttan/thermometer

[Thermometer] Add back button
master
Gordon Williams 2022-08-24 08:45:13 +01:00 committed by GitHub
commit 178c16f08c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -5,3 +5,4 @@
Update every 10s, average last 5 readings Update every 10s, average last 5 readings
Changes based on #1092 Changes based on #1092
0.06: Minor tweaks for stability. Update every 5 seconds 0.06: Minor tweaks for stability. Update every 5 seconds
0.07: Add back button

View File

@ -24,7 +24,7 @@ function onTemperature(p) {
// Gets the temperature in the most accurate way (pressure sensor or inbuilt thermistor) // Gets the temperature in the most accurate way (pressure sensor or inbuilt thermistor)
function drawTemperature() { function drawTemperature() {
if (Bangle.getPressure) { if (Bangle.getPressure) {
Bangle.getPressure().then(p =>{if (p) onTemperature(p)}); Bangle.getPressure().then(p =>{if (p) onTemperature(p);});
} else { } else {
onTemperature({ onTemperature({
temperature : E.getTemperature() temperature : E.getTemperature()
@ -36,6 +36,9 @@ setInterval(function() {
drawTemperature(); drawTemperature();
}, 5000); }, 5000);
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.setUI({
mode : "custom",
back : function() {load();}
});
E.showMessage("Reading temperature..."); E.showMessage("Reading temperature...");
drawTemperature(); drawTemperature();

View File

@ -1,7 +1,7 @@
{ {
"id": "thermom", "id": "thermom",
"name": "Thermometer", "name": "Thermometer",
"version": "0.06", "version": "0.07",
"description": "Displays the current temperature in degree Celsius/Fahrenheit (depending on locale), updates every 10 seconds with average of last 5 readings.", "description": "Displays the current temperature in degree Celsius/Fahrenheit (depending on locale), updates every 10 seconds with average of last 5 readings.",
"icon": "app.png", "icon": "app.png",
"tags": "tool", "tags": "tool",