Merge pull request #2755 from dapgo/master

fixed issue on tempmonitor and minor fiixes
pull/2758/head
Gordon Williams 2023-05-15 10:45:32 +01:00 committed by GitHub
commit 1f30066c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 6 deletions

View File

@ -7,7 +7,7 @@
"type": "clock", "type": "clock",
"tags": "clock", "tags": "clock",
"screenshots": [{"url":"ss_mixdigan_ems.png"}], "screenshots": [{"url":"ss_mixdigan_ems.png"}],
"supports": ["BANGLEJS","BANGLEJS"], "supports": ["BANGLEJS","BANGLEJS2"],
"readme": "README.md", "readme": "README.md",
"allow_emulator": true, "allow_emulator": true,
"storage": [ "storage": [

View File

@ -2,3 +2,4 @@
0.02: added HTML interface 0.02: added HTML interface
0.03: Added Stop/start recording, change BG color, filesize info 0.03: Added Stop/start recording, change BG color, filesize info
0.04: Support for negative degree, Min/Max, random for emulator, clean of code 0.04: Support for negative degree, Min/Max, random for emulator, clean of code
0.05: Fix issue on BJS2 caused by Bangle.getPressure promise

View File

@ -1,7 +1,7 @@
{ {
"id": "tempmonitor", "id": "tempmonitor",
"name": "Temperature monitor", "name": "Temperature monitor",
"version": "0.04", "version": "0.05",
"description": "Another thermometer, besides displaying current temperature, stores it in a CSV file", "description": "Another thermometer, besides displaying current temperature, stores it in a CSV file",
"icon": "app.png", "icon": "app.png",
"tags": "tool", "tags": "tool",

View File

@ -106,9 +106,20 @@ g.flip();
// from: BJS2 pressure sensor, BJS1 inbuilt thermistor // from: BJS2 pressure sensor, BJS1 inbuilt thermistor
function getTemperature() { function getTemperature() {
if(v_model.substr(0,10)!='EMSCRIPTEN'){ if(v_model.substr(0,10)!='EMSCRIPTEN'){
/*//supposed more aqcurate and it works but sometimes promise fails
//Uncaught Error: Unhandled promise rejection: undefined
if (Bangle.getPressure) { if (Bangle.getPressure) {
Bangle.getPressure().then(p =>{if (p) printTemperature(p);}); if (v_mode_debug>1) console.log("getpressure supported but..");
//v_pressure=Bangle.getPressure().then(print);
//wait for premise
Bangle.getPressure().then(p =>{if (p) v_pressureTemp=p.temperature; v_pressurePress=p.pressure;
if (v_mode_debug>1) console.log("getpressure t, p: "+v_pressureTemp+" , "+v_pressurePress);
if ((v_pressureTemp) && (v_pressureTemp!="")) printTemperature(v_pressureTemp)
else printTemperature(E.getTemperature());
});
} else printTemperature(E.getTemperature()); } else printTemperature(E.getTemperature());
}*/
printTemperature(E.getTemperature());
} }
else printTemperature(-11.2+Math.random());//fake temperature medition for emulators else printTemperature(-11.2+Math.random());//fake temperature medition for emulators
} }

View File

@ -1 +1 @@
{"id":"tempmonitor","name":"tempmonitor","src":"tempmonitor.app.js","icon":"tempmonitor.img","version":"0.04","files":"tempmonitor.info,tempmonitor.app.js,tempmonitor.img"} {"id":"tempmonitor","name":"tempmonitor","src":"tempmonitor.app.js","icon":"tempmonitor.img","version":"0.05","files":"tempmonitor.info,tempmonitor.app.js,tempmonitor.img"}