temperature added
parent
2f0ecabd01
commit
5a3317a324
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "HW stats (Bottom) widget",
|
"name": "HW stats (Bottom) widget",
|
||||||
"shortName": "Digital clock Bottom Widget",
|
"shortName": "Digital clock Bottom Widget",
|
||||||
"version": "0.03",
|
"version": "0.03",
|
||||||
"description": "Displays technical info and mem stats in the bottom of the screen (may not be compatible with some apps)",
|
"description": "Displays technical info, such as model, ver, temperatura or mem stats in the bottom of the screen (may not be compatible with some apps)",
|
||||||
"icon": "widhwbttm.png",
|
"icon": "widhwbttm.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"tags": "widget",
|
"tags": "widget",
|
||||||
|
|
|
||||||
|
|
@ -10,40 +10,41 @@
|
||||||
|
|
||||||
function draw(){
|
function draw(){
|
||||||
// if (Bangle.CLOCK) return; //to remove from a clock
|
// if (Bangle.CLOCK) return; //to remove from a clock
|
||||||
|
|
||||||
if (v_count==0) {
|
if (v_count==0) {
|
||||||
v_str_hw=process.env.VERSION.substr(0,6);
|
v_str_hw=process.env.VERSION.substr(0,6);
|
||||||
v_count++;
|
v_count++;
|
||||||
} else if (v_count==1) {
|
} else if (v_count==1) {
|
||||||
v_str_hw=process.env.BOARD.substr(0,3)+".."+process.env.BOARD.substr(process.env.BOARD.length-3,3);
|
v_str_hw=process.env.BOARD.substr(0,3)+".."+process.env.BOARD.substr(process.env.BOARD.length-3,3);
|
||||||
v_count++;
|
v_count++;
|
||||||
}
|
} else if (v_count==2) {
|
||||||
else if (v_count==2) {
|
|
||||||
v_str_hw="Bat "+E.getBattery()+"%";
|
v_str_hw="Bat "+E.getBattery()+"%";
|
||||||
v_count++;
|
v_count++;
|
||||||
}
|
}
|
||||||
|
else if (v_count==3 && v_model.substr(0,6)=='BANGLE') {
|
||||||
|
v_str_hw="Tmp "+E.getTemperature();
|
||||||
|
v_count++;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// text prefix has to be 4char
|
// text prefix has to be 4char
|
||||||
stor=require("Storage").getStats();
|
stor=require("Storage").getStats();
|
||||||
if (v_count==3) {
|
if (v_count==4) {
|
||||||
v_str_hw="Fre "+process.memory().free;
|
v_str_hw="Fre "+process.memory().free;
|
||||||
//+"/"+process.memory().total;
|
//+"/"+process.memory().total;
|
||||||
v_count++;
|
v_count++;
|
||||||
}
|
}
|
||||||
else if (v_count==4) {
|
else if (v_count==5) {
|
||||||
v_str_hw="Sto "+stor.freeBytes;
|
v_str_hw="Sto "+stor.freeBytes;
|
||||||
v_count++;
|
v_count++;
|
||||||
} else if (v_count==5) {
|
} else if (v_count==6) {
|
||||||
v_str_hw="Tra "+stor.trashBytes;
|
v_str_hw="Tra "+stor.trashBytes;
|
||||||
v_count++;
|
v_count++;
|
||||||
} else if (v_count==6) {
|
} else if (v_count==7) {
|
||||||
v_str_hw="Fil "+stor.fileCount;
|
v_str_hw="Fil "+stor.fileCount;
|
||||||
v_count=0;
|
v_count=0;
|
||||||
}
|
}
|
||||||
// 4 char are prefix
|
// 4 char are prefix
|
||||||
if (v_str_hw.length>7) {
|
if (v_str_hw.length>7) {
|
||||||
//replace 3 digits by k
|
//replace 3 digits by k
|
||||||
//substring betw x and y
|
|
||||||
v_str_hw=v_str_hw.substr(0,v_str_hw.length-3)+"k";
|
v_str_hw=v_str_hw.substr(0,v_str_hw.length-3)+"k";
|
||||||
}
|
}
|
||||||
} //end else storage
|
} //end else storage
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue