mirror of https://github.com/espruino/BangleApps
temp monitor interface
parent
c9a7291fcb
commit
5efa613c87
|
@ -26,15 +26,20 @@ function getData() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Otherwise parse the data and output it as a table
|
// Otherwise parse the data and output it as a table
|
||||||
|
//<td>${(new Date(l[0]*1000)).toLocaleString()}</td>
|
||||||
dataElement.innerHTML = `<table>
|
dataElement.innerHTML = `<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Month</th>
|
||||||
|
<th>Day</th>
|
||||||
<th>Time</th>
|
<th>Time</th>
|
||||||
<th>temperature</th>
|
<th>temperature</th>
|
||||||
</tr>`+data.trim().split("\n").map(l=>{
|
</tr>`+data.trim().split("\n").map(l=>{
|
||||||
l = l.split(";");
|
l = l.split(";");
|
||||||
return `<tr>
|
return `<tr>
|
||||||
<td>${(new Date(l[0]*1000)).toLocaleString()}</td>
|
<td>${l[0]}</td>
|
||||||
<td>${l[1]}</td>
|
<td>${l[1]}</td>
|
||||||
|
<td>${l[2]}</td>
|
||||||
|
<td>${l[3]}</td>
|
||||||
</tr>`
|
</tr>`
|
||||||
}).join("\n")+"</table>";
|
}).join("\n")+"</table>";
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"interface": "interface.html",
|
"interface": "interface.html",
|
||||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"screenshots": [{"url":"photo_banglejs1.jpg"}],
|
"screenshots": [{"url":"ss_emul_bjs2.png"}],
|
||||||
"allow_emulator": true,
|
"allow_emulator": true,
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"tempmonitor.app.js","url":"tempmonitor.app.js"},
|
{"name":"tempmonitor.app.js","url":"tempmonitor.app.js"},
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 62 KiB |
|
@ -71,7 +71,8 @@ function saveToFile() {
|
||||||
if (v_mode_debug==1) console.log("saving="+strlastSaveTime+";"+lastMeasure);
|
if (v_mode_debug==1) console.log("saving="+strlastSaveTime+";"+lastMeasure);
|
||||||
|
|
||||||
if (v_saveToFile=='Y'){
|
if (v_saveToFile=='Y'){
|
||||||
require("Storage").open(filename,"a").write(strlastSaveTime+";"+lastMeasure+"\n");
|
//write(strlastSaveTime+";"+
|
||||||
|
require("Storage").open(filename,"a").write(a.getMonth()+";"+a.getDate()+";"+a.getHours()+":"+a.getMinutes()+";"+lastMeasure+"\n");
|
||||||
//(getTime()+",");
|
//(getTime()+",");
|
||||||
v_saved_entries=v_saved_entries+1;
|
v_saved_entries=v_saved_entries+1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue