mirror of https://github.com/espruino/BangleApps
mini improvements
parent
07dea734f2
commit
680587831e
|
@ -8,7 +8,7 @@ var rect = Bangle.appRect;
|
||||||
var history = [];
|
var history = [];
|
||||||
var readFreq=5000; //ms //PEND add to settings
|
var readFreq=5000; //ms //PEND add to settings
|
||||||
var saveFreq=60000; //ms 1min
|
var saveFreq=60000; //ms 1min
|
||||||
var v_saveToFile='Y'; //Y save //N
|
var v_saveToFile= new Boolean(true); //true save //false
|
||||||
//with upload file º is not displayed properly
|
//with upload file º is not displayed properly
|
||||||
//with upload RAM º is displayed
|
//with upload RAM º is displayed
|
||||||
var v_t_symbol="";//ºC
|
var v_t_symbol="";//ºC
|
||||||
|
@ -69,7 +69,7 @@ function saveToFile() {
|
||||||
strlastSaveTime=a.toISOString();
|
strlastSaveTime=a.toISOString();
|
||||||
//strlastSaveTime=strlastSaveTime.concat(a.getFullYear(),a.getMonth()+1,a.getDate(),a.getHours(),a.getMinutes());;
|
//strlastSaveTime=strlastSaveTime.concat(a.getFullYear(),a.getMonth()+1,a.getDate(),a.getHours(),a.getMinutes());;
|
||||||
if (v_mode_debug==1) console.log("saving="+strlastSaveTime+";"+a.getHours()+":"+a.getMinutes()+";"+lastMeasure);
|
if (v_mode_debug==1) console.log("saving="+strlastSaveTime+";"+a.getHours()+":"+a.getMinutes()+";"+lastMeasure);
|
||||||
if (v_saveToFile=='Y'){
|
if (v_saveToFile==true){
|
||||||
//write(strlastSaveTime+";"+
|
//write(strlastSaveTime+";"+
|
||||||
require("Storage").open(filename,"a").write((a.getMonth()+1)+";"+a.getDate()+";"+a.getHours()+":"+a.getMinutes()+";"+lastMeasure+"\n");
|
require("Storage").open(filename,"a").write((a.getMonth()+1)+";"+a.getDate()+";"+a.getHours()+":"+a.getMinutes()+";"+lastMeasure+"\n");
|
||||||
//(getTime()+",");
|
//(getTime()+",");
|
||||||
|
@ -127,7 +127,7 @@ setInterval(function() {
|
||||||
drawTemperature();
|
drawTemperature();
|
||||||
}, readFreq); //ms
|
}, readFreq); //ms
|
||||||
|
|
||||||
if (v_saveToFile=="Y") {
|
if (v_saveToFile==true) {
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
saveToFile();
|
saveToFile();
|
||||||
}, saveFreq); //ms
|
}, saveFreq); //ms
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
# Digital clock widget (bottom widget area)
|
# Digital clock widget (bottom widget area)
|
||||||
This very basic widget clock allows to test the unfrequently used widget bottom area.
|
This very basic widget clock shows time inside apps that respect the bottom widget area, also allows to test this unfrequently used area.
|
||||||
|
|
||||||
|
Note that it will not be displayed when a clock app is been shown
|
||||||
|
|
||||||
|
Compatible with BangleJS1,BangleJS2,and EMSCRIPTENx emulators
|
||||||
|
|
||||||
forked from
|
forked from
|
||||||
https://github.com/espruino/BangleApps/tree/master/apps/widclk
|
https://github.com/espruino/BangleApps/tree/master/apps/widclk
|
||||||
|
@ -10,14 +14,17 @@ Example of usage
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
Screenshot emulator bangle.js2
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Upload the widget file
|
Upload the widget file
|
||||||
Open an app that supports displaying widgets
|
Open an app (not a clock/watchface) that supports displaying widgets (included the bottom one)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,4 +32,4 @@ Open an app that supports displaying widgets
|
||||||
|
|
||||||
This app is so basic that probably the easiest is to just edit the code ;)
|
This app is so basic that probably the easiest is to just edit the code ;)
|
||||||
|
|
||||||
Otherwise you can contact me [here](https://github.com/dapgo)
|
Otherwise you can contact me [here](https://github.com/dapgo/my_espruino_smartwatch_things)
|
|
@ -3,11 +3,12 @@
|
||||||
"name": "Digital clock (Bottom) widget",
|
"name": "Digital clock (Bottom) widget",
|
||||||
"shortName": "Digital clock Bottom Widget",
|
"shortName": "Digital clock Bottom Widget",
|
||||||
"version": "0.05",
|
"version": "0.05",
|
||||||
"description": "Displays time in the bottom of the screen (may not be compatible with some apps)",
|
"description": "Displays time HH:mm in the bottom of the screen (may not be compatible with some apps)",
|
||||||
"icon": "widclkbttm.png",
|
"icon": "widclkbttm.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"tags": "widget",
|
"tags": "widget",
|
||||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||||
|
"screenshots": [{"url":"ss_bjs1.png"}],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"widclkbttm.wid.js","url":"widclkbttm.wid.js"}
|
{"name":"widclkbttm.wid.js","url":"widclkbttm.wid.js"}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -1,6 +1,11 @@
|
||||||
WIDGETS["wdclkbttm"]={area:"br",width:Bangle.CLOCK?0:60,draw:function() {
|
WIDGETS["wdclkbttm"]={area:"br",width:Bangle.CLOCK?0:60,draw:function() {
|
||||||
|
console.log("clock? "+Bangle.CLOCK);
|
||||||
|
if (Bangle.CLOCK){
|
||||||
|
console.log("clock and return");
|
||||||
|
return;
|
||||||
|
};
|
||||||
if (!Bangle.CLOCK == !this.width) { // if we're the wrong size for if we have a clock or not...
|
if (!Bangle.CLOCK == !this.width) { // if we're the wrong size for if we have a clock or not...
|
||||||
this.width = Bangle.CLOCK?0:60;
|
this.width = Bangle.CLOCK?0:60;
|
||||||
return setTimeout(Bangle.drawWidgets,1); // widget changed size - redraw
|
return setTimeout(Bangle.drawWidgets,1); // widget changed size - redraw
|
||||||
}
|
}
|
||||||
if (!this.width) return; // if size not right, return
|
if (!this.width) return; // if size not right, return
|
||||||
|
|
Loading…
Reference in New Issue