Merge pull request #2340 from myxor/weather_clkinfo

Weather clkinfo: weather condition with temperature
master
Gordon Williams 2022-12-01 14:24:27 +00:00 committed by GitHub
commit 1bb9b68e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

View File

@ -16,3 +16,4 @@
0.17: Added clkinfo for clocks.
0.18: Added hasRange to clkinfo.
0.19: Added weather condition to clkinfo.
0.20: Added weather condition with temperature to clkinfo.

View File

@ -30,11 +30,18 @@
name: "Weather",
img: atob("GBiBAf+///u5//n7//8f/9wHP8gDf/gB//AB/7AH/5AcP/AQH/DwD/uAD84AD/4AA/wAAfAAAfAAAfAAAfgAA/////+bP/+zf/+zfw=="),
items: [
{
name: "conditionWithTemperature",
get: () => ({ text: weather.temp, img: weatherIcon(weather.code),
v: parseInt(weather.temp), min: -30, max: 55}),
show: function() { this.emit("redraw"); },
hide: function () {}
},
{
name: "condition",
get: () => ({ text: weather.txt, img: weatherIcon(weather.code),
v: weather.code}),
show: function() { weatherItems.items[0].emit("redraw"); },
show: function() { this.emit("redraw"); },
hide: function () {}
},
{
@ -42,7 +49,7 @@
hasRange : true,
get: () => ({ text: weather.temp, img: atob("GBiBAAA8AAB+AADnAADDAADDAADDAADDAADDAADbAADbAADbAADbAADbAADbAAHbgAGZgAM8wAN+wAN+wAM8wAGZgAHDgAD/AAA8AA=="),
v: parseInt(weather.temp), min: -30, max: 55}),
show: function() { weatherItems.items[1].emit("redraw"); },
show: function() { this.emit("redraw"); },
hide: function () {}
},
{
@ -50,7 +57,7 @@
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=="),
v: parseInt(weather.hum), min: 0, max: 100}),
show: function() { weatherItems.items[2].emit("redraw"); },
show: function() { this.emit("redraw"); },
hide: function () {}
},
{
@ -58,7 +65,7 @@
hasRange : true,
get: () => ({ text: weather.wind, img: atob("GBiBAAHgAAPwAAYYAAwYAAwMfAAY/gAZh3/xg//hgwAAAwAABg///g//+AAAAAAAAP//wH//4AAAMAAAMAAYMAAYMAAMcAAP4AADwA=="),
v: parseInt(weather.wind), min: 0, max: 118}),
show: function() { weatherItems.items[3].emit("redraw"); },
show: function() { this.emit("redraw"); },
hide: function () {}
},
]

View File

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