Skip to content

Commit

Permalink
Merge pull request #1512 from fwitte/features/currentweather_weatherf…
Browse files Browse the repository at this point in the history
…orecost_degreesign

still show degree sign if degreeLabel/scale is false
  • Loading branch information
MichMich authored Jan 8, 2019
2 parents 50545a8 + c2ff949 commit 0a340d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

### 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).
- 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)
Expand Down
13 changes: 8 additions & 5 deletions modules/default/currentweather/currentweather.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,19 @@ Module.register("currentweather",{
large.appendChild(weatherIcon);

var degreeLabel = "";
if (this.config.degreeLabel) {
switch (this.config.units ) {
if (this.config.units === "metric" || this.config.units === "imperial") {
degreeLabel += "°";
}
if(this.config.degreeLabel) {
switch(this.config.units) {
case "metric":
degreeLabel = " °C";
degreeLabel += "C";
break;
case "imperial":
degreeLabel = " °F";
degreeLabel += "F";
break;
case "default":
degreeLabel = " K";
degreeLabel += "K";
break;
}
}
Expand Down
9 changes: 6 additions & 3 deletions modules/default/weatherforecast/weatherforecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,19 @@ Module.register("weatherforecast",{
iconCell.appendChild(icon);

var degreeLabel = "";
if (this.config.units === "metric" || this.config.units === "imperial") {
degreeLabel += "°";
}
if(this.config.scale) {
switch(this.config.units) {
case "metric":
degreeLabel = " °C";
degreeLabel += "C";
break;
case "imperial":
degreeLabel = " °F";
degreeLabel += "F";
break;
case "default":
degreeLabel = " K";
degreeLabel = "K";
break;
}
}
Expand Down

0 comments on commit 0a340d5

Please sign in to comment.