diff --git a/apps/weather/ChangeLog b/apps/weather/ChangeLog index b8b5542821..10f726e90a 100644 --- a/apps/weather/ChangeLog +++ b/apps/weather/ChangeLog @@ -33,4 +33,6 @@ Add button to settings to force fetch weather data (requires GadgetBridge version 0.86.0 or higher) Add new API to get weather from Weather App for other Apps 0.31: Wind speed clockInfo now shows speed in local units (kph or mph) -0.32: Add widget configuration settings menu for icon style, data displayed, etc. \ No newline at end of file +0.32: Add widget configuration settings menu for icon style, data displayed, etc. + ClockInfos now show the high/low temp as the min/max for displaying a percent bar. +0.33: Fix bugs with weather app and clock info diff --git a/apps/weather/app.js b/apps/weather/app.js index f8255568ae..57f667e165 100644 --- a/apps/weather/app.js +++ b/apps/weather/app.js @@ -105,7 +105,7 @@ function draw() { layout.windUnit.label = `${wind[2]} ${(current.wrose||'').toUpperCase()}`; layout.cond.label = current.txt.charAt(0).toUpperCase()+(current.txt||'').slice(1); layout.loc.label = current.loc; - layout.updateTime.label = `${formatDuration(Date.now() - current.time)} ago`; // How to autotranslate this and similar? + layout.updateTime.label = `${formatDuration(Date.now() - current.time)}`; // How to autotranslate this and similar? layout.update(); layout.render(); } diff --git a/apps/weather/clkinfo.js b/apps/weather/clkinfo.js index 5a0443efa7..01f576f27c 100644 --- a/apps/weather/clkinfo.js +++ b/apps/weather/clkinfo.js @@ -10,6 +10,9 @@ weather.hum = `${weather.hum}%`; weather.wind = require("locale").speed(weather.wind).match(/^(\D*\d*)(.*)$/); weather.wind = Math.round(weather.wind[1]) +" "+ weather.wind[2]; + if(weather.hi) weather.hi = parseInt(require("locale").temp(weather.hi-273.15)); + if(weather.lo) weather.lo = parseInt(require("locale").temp(weather.lo-273.15)); + } else { weather = { @@ -47,7 +50,7 @@ hasRange : true, get: () => ({ text: weather.temp, img: weatherIcon(weather.code), color: weatherLib.getColor(weather.code), - v: parseInt(weather.temp), min: weather.lo?weather.lo:-30, max: weather.hi?weather.hi:-30}), + v: parseInt(weather.temp), min: weather.lo?weather.lo:-30, max: weather.hi?weather.hi:50}), show: function() { this.updater = _updater.bind(this); weatherLib.on("update", this.updater); @@ -71,7 +74,7 @@ name: "temperature", hasRange : true, get: () => ({ text: weather.temp, img: atob("GBiBAAA8AAB+AADnAADDAADDAADDAADDAADDAADbAADbAADbAADbAADbAADbAAHbgAGZgAM8wAN+wAN+wAM8wAGZgAHDgAD/AAA8AA=="), - v: parseInt(weather.temp), min: weather.lo?weather.lo:-30, max: weather.hi?weather.hi:-30}), + v: parseInt(weather.temp), min: weather.lo?weather.lo:-30, max: weather.hi?weather.hi:50}), show: function() { this.updater = _updater.bind(this); weatherLib.on("update", this.updater); @@ -83,7 +86,7 @@ name: "feelsLike", hasRange : true, get: () => ({ text: weather.feels, img: atob("GBiBAAAAAAHAAAPgAAfgAAfgAAfg4APhsAfxEB/5EB/5ED/9ED/9ED/9ED/9ED/9EB/9UB/7UA/yyAf26Afk7AfmyAfjGAfh8AAAAA=="), - v: parseInt(weather.feels), min: weather.lo?weather.lo:-30, max: weather.hi?weather.hi:-30}), + v: parseInt(weather.feels), min: weather.lo?weather.lo:-30, max: weather.hi?weather.hi:50}), show: function() { this.updater = _updater.bind(this); weatherLib.on("update", this.updater); @@ -119,4 +122,4 @@ }; return weatherItems; -}) \ No newline at end of file +}) diff --git a/apps/weather/metadata.json b/apps/weather/metadata.json index 495ed2a7ca..df726457cd 100644 --- a/apps/weather/metadata.json +++ b/apps/weather/metadata.json @@ -1,7 +1,7 @@ { "id": "weather", "name": "Weather", - "version": "0.32", + "version": "0.33", "description": "Show Gadgetbridge/iOS weather report", "icon": "icon.png", "screenshots": [{"url":"Screenshot.png"}],