From dc363de61037c7608e3ef37cdb59f472b176d279 Mon Sep 17 00:00:00 2001 From: fewieden Date: Fri, 4 Jan 2019 19:43:07 +0100 Subject: [PATCH 1/6] fix weather forecast table height --- modules/default/weather/weather.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/default/weather/weather.css b/modules/default/weather/weather.css index dfa2b12adb..3a061bd4bd 100644 --- a/modules/default/weather/weather.css +++ b/modules/default/weather/weather.css @@ -36,6 +36,10 @@ padding-right: 0; } +.weather tr .weathericon { + line-height: 25px; +} + .weather tr.colored .min-temp { color: #bcddff; } From 827fbfb78f1d120b84d1fe84661e8fbbf1537634 Mon Sep 17 00:00:00 2001 From: fewieden Date: Fri, 4 Jan 2019 19:43:48 +0100 Subject: [PATCH 2/6] dimmed loading indicator for weather forecast --- modules/default/weather/forecast.njk | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 1f24786702..556a98ff05 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -1,25 +1,27 @@ {% if forecast %} - +
{% for f in forecast %} - - + + {% if config.showRainAmount %} {% endif %} {% endfor %}
{{f.date.format('ddd')}}{{ f.date.format('ddd') }} - {{f.maxTemperature | roundValue | unit("temperature")}} + {{ f.maxTemperature | roundValue | unit("temperature") }} - {{f.minTemperature | roundValue | unit("temperature")}} + {{ f.minTemperature | roundValue | unit("temperature") }} - {{f.rain | unit("rain")}} + {{ f.rain | unit("rain") }}
{% else %} - {{"LOADING" | translate}} +
+ {{ "LOADING" | translate }} +
{% endif %} From 5759ed3728b1329502e0dbfffa109caa5e69473b Mon Sep 17 00:00:00 2001 From: fewieden Date: Fri, 4 Jan 2019 19:46:54 +0100 Subject: [PATCH 3/6] implemented config option decimal symbol, align indoor elements vertical, add humidity support to nunjuck unit filter, do not display degree symbol for kelvin --- modules/default/weather/current.njk | 45 ++++++++++++++++------------- modules/default/weather/weather.js | 11 ++++++- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk index aed51ac6bb..55720e23e1 100644 --- a/modules/default/weather/current.njk +++ b/modules/default/weather/current.njk @@ -4,31 +4,30 @@ {% if config.useBeaufort %} - {{current.beaufortWindSpeed() | round}} + {{ current.beaufortWindSpeed() | round }} {% else %} - {{current.windSpeed | round}} + {{ current.windSpeed | round }} {% endif %} - {% if config.showWindDirection %} {% if config.showWindDirectionAsArrow %} - + {% else %} - {{current.cardinalWindDirection() | translate}} + {{ current.cardinalWindDirection() | translate }} {% endif %}   {% endif %} {% if config.showHumidity and current.humidity %} - {{ current.humidity }}  + {{ current.humidity | decimalSymbol }}  {% endif %} - + {% if current.nextSunAction() == "sunset" %} - {{current.sunset | formatTime}} + {{ current.sunset | formatTime }} {% else %} - {{current.sunrise | formatTime}} + {{ current.sunrise | formatTime }} {% endif %} @@ -36,31 +35,37 @@
- {{current.temperature | roundValue | unit("temperature")}} + {{ current.temperature | roundValue | unit("temperature") | decimalSymbol }} +
+
{% if config.showIndoorTemperature and indoor.temperature %} - - - {{indoor.temperature | roundValue | unit("temperature")}} - +
+ + + {{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }} + +
{% endif %} {% if config.showIndoorHumidity and indoor.humidity %} - - - {{indoor.humidity | roundValue}}% - +
+ + + {{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }} + +
{% endif %}
{% if config.showFeelsLike and not config.onlyTemp %}
- {{ "FEELS" | translate }} {{ current.feelsLike() | roundValue | unit("temperature") }} + {{ "FEELS" | translate }} {{ current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }}
{% endif %} {% else %}
- {{"LOADING" | translate}} + {{ "LOADING" | translate }}
{% endif %} diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index eff3f90e98..52e9cfee5d 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -30,6 +30,7 @@ Module.register("weather",{ lang: config.language, showHumidity: false, degreeLabel: false, + decimalSymbol: ".", showIndoorTemperature: false, showIndoorHumidity: false, @@ -184,7 +185,9 @@ Module.register("weather",{ this.nunjucksEnvironment().addFilter("unit", function (value, type) { if (type === "temperature") { - value += "°"; + if (this.config.units === "metric" || this.config.units === "imperial") { + value += "°"; + } if (this.config.degreeLabel) { if (this.config.units === "metric") { value += "C"; @@ -200,6 +203,8 @@ Module.register("weather",{ } else { value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; } + } else if (type === "humidity") { + value += "%" } return value; @@ -208,5 +213,9 @@ Module.register("weather",{ this.nunjucksEnvironment().addFilter("roundValue", function(value) { return this.roundValue(value); }.bind(this)); + + this.nunjucksEnvironment().addFilter("decimalSymbol", function(value) { + return value.replace(/\./g, this.config.decimalSymbol); + }.bind(this)); } }); From 5d22dbd99e6fa008e8e41757f96640de48784f72 Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 5 Jan 2019 10:26:13 +0100 Subject: [PATCH 4/6] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34cbf9f74..07c9206915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). +### New weather module +- Fixed weather forecast table display. +- Dimmed loading indicator for weather forecast. +- Implemented config option `decimalSymbol`. +- Aligned indoor values in current weather vertical. +- Added humidity support to nunjuck unit filter. +- Do not display degree symbol for temperature in Kelvin. + ## [2.6.0] - 2019-01-01 ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues updating, make sure you are running the latest version of Node. From b79b48baac929bcbf762f07ab6890713ce93caae Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 5 Jan 2019 10:32:09 +0100 Subject: [PATCH 5/6] link issues to changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c9206915..1c346acef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,10 +22,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). ### New weather module -- Fixed weather forecast table display. +- Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Dimmed loading indicator for weather forecast. -- Implemented config option `decimalSymbol`. -- Aligned indoor values in current weather vertical. +- Implemented config option `decimalSymbol` [#1499](https://github.com/MichMich/MagicMirror/issues/1499). +- Aligned indoor values in current weather vertical [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Added humidity support to nunjuck unit filter. - Do not display degree symbol for temperature in Kelvin. From aa6699cf3e611ced83893dc8c52ce8e91e788c1a Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 5 Jan 2019 10:33:58 +0100 Subject: [PATCH 6/6] link issues to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c346acef8..75a849a2e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Implemented config option `decimalSymbol` [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Aligned indoor values in current weather vertical [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Added humidity support to nunjuck unit filter. -- Do not display degree symbol for temperature in Kelvin. +- Do not display degree symbol for temperature in Kelvin [#1503](https://github.com/MichMich/MagicMirror/issues/1503). ## [2.6.0] - 2019-01-01