Merge pull request #1512 from fwitte/features/currentweather_weatherforecost_degreesign

still show degree sign if degreeLabel/scale is false
This commit is contained in:
Michael Teeuw 2019-01-08 09:36:26 +01:00 committed by GitHub
commit 0a340d5d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 9 deletions

View File

@ -18,7 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500)
### Fixed ### Fixed
- Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511).
- Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - 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). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504).
- Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611) - Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611)

View File

@ -198,16 +198,19 @@ Module.register("currentweather",{
large.appendChild(weatherIcon); large.appendChild(weatherIcon);
var degreeLabel = ""; var degreeLabel = "";
if (this.config.degreeLabel) { if (this.config.units === "metric" || this.config.units === "imperial") {
switch (this.config.units ) { degreeLabel += "°";
}
if(this.config.degreeLabel) {
switch(this.config.units) {
case "metric": case "metric":
degreeLabel = " °C"; degreeLabel += "C";
break; break;
case "imperial": case "imperial":
degreeLabel = " °F"; degreeLabel += "F";
break; break;
case "default": case "default":
degreeLabel = " K"; degreeLabel += "K";
break; break;
} }
} }

View File

@ -143,16 +143,19 @@ Module.register("weatherforecast",{
iconCell.appendChild(icon); iconCell.appendChild(icon);
var degreeLabel = ""; var degreeLabel = "";
if (this.config.units === "metric" || this.config.units === "imperial") {
degreeLabel += "°";
}
if(this.config.scale) { if(this.config.scale) {
switch(this.config.units) { switch(this.config.units) {
case "metric": case "metric":
degreeLabel = " °C"; degreeLabel += "C";
break; break;
case "imperial": case "imperial":
degreeLabel = " °F"; degreeLabel += "F";
break; break;
case "default": case "default":
degreeLabel = " K"; degreeLabel = "K";
break; break;
} }
} }