Update clock_info to avoid a redraw/general tidyups

pull/2408/head
Gordon Williams 2022-12-16 15:40:58 +00:00
parent 260bb1bcda
commit 8425f0b50a
24 changed files with 39 additions and 44 deletions

View File

@ -8,3 +8,4 @@
0.08: Fix error in clkinfo (didn't require Storage & locale) 0.08: Fix error in clkinfo (didn't require Storage & locale)
Fix clkinfo icon Fix clkinfo icon
0.09: Ensure Agenda supplies an image for clkinfo items 0.09: Ensure Agenda supplies an image for clkinfo items
0.10: Update clock_info to avoid a redraw

View File

@ -20,7 +20,7 @@
agendaItems.items.push({ agendaItems.items.push({
name: "Agenda "+i, name: "Agenda "+i,
get: () => ({ text: title + "\n" + dateStr, img: agendaItems.img }), get: () => ({ text: title + "\n" + dateStr, img: agendaItems.img }),
show: function() { agendaItems.items[i].emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}); });
}); });

View File

@ -1,7 +1,7 @@
{ {
"id": "agenda", "id": "agenda",
"name": "Agenda", "name": "Agenda",
"version": "0.09", "version": "0.10",
"description": "Simple agenda", "description": "Simple agenda",
"icon": "agenda.png", "icon": "agenda.png",
"screenshots": [{"url":"screenshot_agenda_overview.png"}, {"url":"screenshot_agenda_event1.png"}, {"url":"screenshot_agenda_event2.png"}], "screenshots": [{"url":"screenshot_agenda_overview.png"}, {"url":"screenshot_agenda_event1.png"}, {"url":"screenshot_agenda_event2.png"}],

View File

@ -21,3 +21,4 @@
0.21: On the default menu the week of year can be shown. 0.21: On the default menu the week of year can be shown.
0.22: Use the new clkinfo module for the menu. 0.22: Use the new clkinfo module for the menu.
0.23: Feedback of apps after run is now optional and decided by the corresponding clkinfo. 0.23: Feedback of apps after run is now optional and decided by the corresponding clkinfo.
0.24: Update clock_info to avoid a redraw

View File

@ -93,7 +93,7 @@ var bwItems = {
items: [ items: [
{ name: "WeekOfYear", { name: "WeekOfYear",
get: () => ({ text: "Week " + weekOfYear(), img: null}), get: () => ({ text: "Week " + weekOfYear(), img: null}),
show: function() { bwItems.items[0].emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
] ]

View File

@ -1,7 +1,7 @@
{ {
"id": "bwclk", "id": "bwclk",
"name": "BW Clock", "name": "BW Clock",
"version": "0.23", "version": "0.24",
"description": "A very minimalistic clock to mainly show date and time.", "description": "A very minimalistic clock to mainly show date and time.",
"readme": "README.md", "readme": "README.md",
"icon": "app.png", "icon": "app.png",

View File

@ -1 +1,2 @@
0.01: First release 0.01: First release
0.02: Update clock_info to avoid a redraw and image allocation

View File

@ -4,26 +4,13 @@
items: [ items: [
{ name : "FW", { name : "FW",
get : () => { get : () => {
let d = new Date();
let g = Graphics.createArrayBuffer(24,24,1,{msb:true});
g.drawImage(atob("GBjC////AADve773VWmmmmlVVW22nnlVVbLL445VVwAAAADVWAAAAAAlrAAAAAA6sAAAAAAOWAAAAAAlrAD//wA6sANVVcAOWANVVcAlrANVVcA6rANVVcA6WANVVcAlsANVVcAOrAD//wA6WAAAAAAlsAAAAAAOrAAAAAA6WAAAAAAlVwAAAADVVbLL445VVW22nnlVVWmmmmlV"),1,0);
return { return {
text : process.env.VERSION, text : process.env.VERSION,
img : g.asImage("string") img : atob("GBjC////AADve773VWmmmmlVVW22nnlVVbLL445VVwAAAADVWAAAAAAlrAAAAAA6sAAAAAAOWAAAAAAlrAD//wA6sANVVcAOWANVVcAlrANVVcA6rANVVcA6WANVVcAlsANVVcAOrAD//wA6WAAAAAAlsAAAAAAOrAAAAAA6WAAAAAAlVwAAAADVVbLL445VVW22nnlVVWmmmmlV")
}; };
}, },
show : function() { show : function() {},
this.interval = setTimeout(()=>{ hide : function() {}
this.emit("redraw");
this.interval = setInterval(()=>{
this.emit("redraw");
}, 86400000);
}, 86400000 - (Date.now() % 86400000));
},
hide : function() {
clearInterval(this.interval);
this.interval = undefined;
}
} }
] ]
}; };

View File

@ -1,6 +1,6 @@
{ "id": "clkinfofw", { "id": "clkinfofw",
"name": "Firmware Clockinfo", "name": "Firmware Clockinfo",
"version":"0.01", "version":"0.02",
"description": "For clocks that display 'clockinfo', this displays the firmware version string", "description": "For clocks that display 'clockinfo', this displays the firmware version string",
"icon": "app.png", "icon": "app.png",
"type": "clkinfo", "type": "clkinfo",

View File

@ -4,3 +4,4 @@
0.04: Feedback if clkinfo run is called. 0.04: Feedback if clkinfo run is called.
0.05: Clkinfo improvements. 0.05: Clkinfo improvements.
0.06: Updated clkinfo icon. 0.06: Updated clkinfo icon.
0.07: Update clock_info to avoid a redraw

View File

@ -12,7 +12,7 @@
haItems.items.push({ haItems.items.push({
name: null, name: null,
get: () => ({ text: trigger.display, img: trigger.getIcon()}), get: () => ({ text: trigger.display, img: trigger.getIcon()}),
show: function() { haItems.items[i].emit("redraw"); }, show: function() {},
hide: function () {}, hide: function () {},
run: function() { run: function() {
ha.sendTrigger("TRIGGER_BW"); ha.sendTrigger("TRIGGER_BW");

View File

@ -1,7 +1,7 @@
{ {
"id": "ha", "id": "ha",
"name": "HomeAssistant", "name": "HomeAssistant",
"version": "0.06", "version": "0.07",
"description": "Integrates your BangleJS into HomeAssistant.", "description": "Integrates your BangleJS into HomeAssistant.",
"icon": "ha.png", "icon": "ha.png",
"type": "app", "type": "app",

View File

@ -1,2 +1,3 @@
0.01: New App. 0.01: New App.
0.02: Performance improvements. 0.02: Performance improvements.
0.03: Update clock_info to avoid a redraw

View File

@ -52,22 +52,22 @@ var H = g.getHeight();
items: [ items: [
{ name: "time", { name: "time",
get: () => ({ text: getTime(), img: null}), get: () => ({ text: getTime(), img: null}),
show: function() { dateMenu.items[0].emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ name: "day", { name: "day",
get: () => ({ text: getDay(), img: null}), get: () => ({ text: getDay(), img: null}),
show: function() { dateMenu.items[2].emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ name: "date", { name: "date",
get: () => ({ text: getDate(), img: null}), get: () => ({ text: getDate(), img: null}),
show: function() { dateMenu.items[1].emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ name: "week", { name: "week",
get: () => ({ text: weekOfYear(), img: null}), get: () => ({ text: weekOfYear(), img: null}),
show: function() { dateMenu.items[3].emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
] ]

View File

@ -1,7 +1,7 @@
{ {
"id": "linuxclock", "id": "linuxclock",
"name": "Linux Clock", "name": "Linux Clock",
"version": "0.02", "version": "0.03",
"description": "A Linux inspired clock.", "description": "A Linux inspired clock.",
"readme": "README.md", "readme": "README.md",
"icon": "app.png", "icon": "app.png",

View File

@ -18,3 +18,4 @@
0.15: Automatic translation of some string in clkinfo 0.15: Automatic translation of some string in clkinfo
0.16: Improve support for date timezone 0.16: Improve support for date timezone
0.17: Fix midnight in local timezone (alarms wouldn't always fire as expected in timezone != 0) 0.17: Fix midnight in local timezone (alarms wouldn't always fire as expected in timezone != 0)
0.18: Update clock_info to avoid a redraw

View File

@ -63,7 +63,7 @@
hasRange: true, hasRange: true,
get: () => ({ text: getAlarmText(a), img: getAlarmIcon(a), get: () => ({ text: getAlarmText(a), img: getAlarmIcon(a),
v: getAlarmValue(a), min:0, max:getAlarmMax(a)}), v: getAlarmValue(a), min:0, max:getAlarmMax(a)}),
show: function() { alarmItems.items[i].emit("redraw"); }, show: function() {},
hide: function () {}, hide: function () {},
run: function() { } run: function() { }
})), })),

View File

@ -1,7 +1,7 @@
{ {
"id": "sched", "id": "sched",
"name": "Scheduler", "name": "Scheduler",
"version": "0.17", "version": "0.18",
"description": "Scheduling library for alarms and timers", "description": "Scheduling library for alarms and timers",
"icon": "app.png", "icon": "app.png",
"type": "scheduler", "type": "scheduler",

View File

@ -4,3 +4,4 @@
0.04: Improvements of clock infos. 0.04: Improvements of clock infos.
0.05: Updated clkinfo icon. 0.05: Updated clkinfo icon.
0.06: Ensure Timer supplies an image for clkinfo items 0.06: Ensure Timer supplies an image for clkinfo items
0.07: Update clock_info to avoid a redraw

View File

@ -70,7 +70,7 @@
{ {
name: null, name: null,
get: () => ({ text: getAlarmMinutesText() + (isAlarmEnabled() ? " min" : ""), img: smpltmrItems.img }), get: () => ({ text: getAlarmMinutesText() + (isAlarmEnabled() ? " min" : ""), img: smpltmrItems.img }),
show: function() { smpltmrItems.items[0].emit("redraw"); }, show: function() {},
hide: function () {}, hide: function () {},
run: function() { } run: function() { }
}, },
@ -82,7 +82,7 @@
smpltmrItems.items = smpltmrItems.items.concat({ smpltmrItems.items = smpltmrItems.items.concat({
name: null, name: null,
get: () => ({ text: (o > 0 ? "+" : "") + o + " min.", img: smpltmrItems.img }), get: () => ({ text: (o > 0 ? "+" : "") + o + " min.", img: smpltmrItems.img }),
show: function() { smpltmrItems.items[i+1].emit("redraw"); }, show: function() {},
hide: function () {}, hide: function () {},
run: function() { run: function() {
if(o > 0) increaseAlarm(o); if(o > 0) increaseAlarm(o);

View File

@ -2,7 +2,7 @@
"id": "smpltmr", "id": "smpltmr",
"name": "Simple Timer", "name": "Simple Timer",
"shortName": "Simple Timer", "shortName": "Simple Timer",
"version": "0.06", "version": "0.07",
"description": "A very simple app to start a timer.", "description": "A very simple app to start a timer.",
"icon": "app.png", "icon": "app.png",
"tags": "tool,alarm,timer,clkinfo", "tags": "tool,alarm,timer,clkinfo",

View File

@ -19,3 +19,4 @@
0.20: Added weather condition with temperature to clkinfo. 0.20: Added weather condition with temperature to clkinfo.
0.21: Updated clkinfo icon. 0.21: Updated clkinfo icon.
0.22: Automatic translation of strings, some left untranslated. 0.22: Automatic translation of strings, some left untranslated.
0.23: Update clock_info to avoid a redraw

View File

@ -34,14 +34,14 @@
name: "conditionWithTemperature", name: "conditionWithTemperature",
get: () => ({ text: weather.temp, img: weatherIcon(weather.code), get: () => ({ text: weather.temp, img: weatherIcon(weather.code),
v: parseInt(weather.temp), min: -30, max: 55}), v: parseInt(weather.temp), min: -30, max: 55}),
show: function() { this.emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ {
name: "condition", name: "condition",
get: () => ({ text: weather.txt, img: weatherIcon(weather.code), get: () => ({ text: weather.txt, img: weatherIcon(weather.code),
v: weather.code}), v: weather.code}),
show: function() { this.emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ {
@ -49,7 +49,7 @@
hasRange : true, hasRange : true,
get: () => ({ text: weather.temp, img: atob("GBiBAAA8AAB+AADnAADDAADDAADDAADDAADDAADbAADbAADbAADbAADbAADbAAHbgAGZgAM8wAN+wAN+wAM8wAGZgAHDgAD/AAA8AA=="), get: () => ({ text: weather.temp, img: atob("GBiBAAA8AAB+AADnAADDAADDAADDAADDAADDAADbAADbAADbAADbAADbAADbAAHbgAGZgAM8wAN+wAN+wAM8wAGZgAHDgAD/AAA8AA=="),
v: parseInt(weather.temp), min: -30, max: 55}), v: parseInt(weather.temp), min: -30, max: 55}),
show: function() { this.emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ {
@ -57,7 +57,7 @@
hasRange : true, hasRange : true,
get: () => ({ text: weather.hum, img: atob("GBiBAAAEAAAMAAAOAAAfAAAfAAA/gAA/gAI/gAY/AAcfAA+AQA+A4B/A4D/B8D/h+D/j+H/n/D/n/D/n/B/H/A+H/AAH/AAD+AAA8A=="), get: () => ({ text: weather.hum, img: atob("GBiBAAAEAAAMAAAOAAAfAAAfAAA/gAA/gAI/gAY/AAcfAA+AQA+A4B/A4D/B8D/h+D/j+H/n/D/n/D/n/B/H/A+H/AAH/AAD+AAA8A=="),
v: parseInt(weather.hum), min: 0, max: 100}), v: parseInt(weather.hum), min: 0, max: 100}),
show: function() { this.emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
{ {
@ -65,7 +65,7 @@
hasRange : true, hasRange : true,
get: () => ({ text: weather.wind, img: atob("GBiBAAHgAAPwAAYYAAwYAAwMfAAY/gAZh3/xg//hgwAAAwAABg///g//+AAAAAAAAP//wH//4AAAMAAAMAAYMAAYMAAMcAAP4AADwA=="), get: () => ({ text: weather.wind, img: atob("GBiBAAHgAAPwAAYYAAwYAAwMfAAY/gAZh3/xg//hgwAAAwAABg///g//+AAAAAAAAP//wH//4AAAMAAAMAAYMAAYMAAMcAAP4AADwA=="),
v: parseInt(weather.wind), min: 0, max: 118}), v: parseInt(weather.wind), min: 0, max: 118}),
show: function() { this.emit("redraw"); }, show: function() {},
hide: function () {} hide: function () {}
}, },
] ]

View File

@ -1,7 +1,7 @@
{ {
"id": "weather", "id": "weather",
"name": "Weather", "name": "Weather",
"version": "0.22", "version": "0.23",
"description": "Show Gadgetbridge weather report", "description": "Show Gadgetbridge weather report",
"icon": "icon.png", "icon": "icon.png",
"screenshots": [{"url":"screenshot.png"}], "screenshots": [{"url":"screenshot.png"}],