Skip to content

Commit

Permalink
Merge pull request #42 from mtatsuma/test_image
Browse files Browse the repository at this point in the history
Add an option to use large weather icons from OpenWeather
  • Loading branch information
mtatsuma authored Jan 26, 2022
2 parents 78dbe33 + 0831293 commit 4237718
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MMM-WeatherChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Module.register("MMM-WeatherChart", {
datalabelsDisplay: "auto",
datalabelsOffset: 4,
datalabelsRoundDecimalPlace: 1,
largeOpenWeatherIcon: false,
},

requiresVersion: "2.15.0",
Expand Down Expand Up @@ -158,7 +159,11 @@ Module.register("MMM-WeatherChart", {
let self = this;
let iconImage = new Image();
if (iconId) {
iconImage.src = this.config.iconURLBase + iconId + ".png";
if (this.config.largeOpenWeatherIcon) {
iconImage.src = this.config.iconURLBase + iconId + "@2x.png";
} else {
iconImage.src = this.config.iconURLBase + iconId + ".png";
}
}
return iconImage;
},
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ You can check [available MMM-WeatherChart versions](https://github.com/mtatsuma/
| datalabelsDisplay | | `auto` | Visibility of data labels. See https://chartjs-plugin-datalabels.netlify.app/guide/positioning.html#visibility for details.
| datalabelsOffset | | `4` | Offset of data labels. See https://chartjs-plugin-datalabels.netlify.app/guide/positioning.html#alignment-and-offset for details.
| datalabelsRoundDecimalPlace | | `1` | Decimal place to which round for data labels on charts. When you set this option as `0`, the labels are rounded to integer. This option is affected only on the labels (not affected on the data values). |
| largeOpenWeatherIcon | | `false` | `true` or `false`. Weather Icons from OpenWeather becomes 2 times larger (100 x 100) if true. |

0 comments on commit 4237718

Please sign in to comment.