From 32df3e80b135971ac15bc43228d66d84defc50e3 Mon Sep 17 00:00:00 2001 From: Olexandr Savchuk Date: Fri, 2 Dec 2016 17:33:41 +0100 Subject: [PATCH] Renamed roundTemperature option to roundTemp Added changelog entry --- CHANGELOG.md | 1 + modules/default/currentweather/README.md | 2 +- modules/default/currentweather/currentweather.js | 6 +++--- modules/default/weatherforecast/README.md | 2 +- modules/default/weatherforecast/weatherforecast.js | 5 +++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3acbcc4..0acfecc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added option `address` to set bind address. - Added option `onlyTemp` for currentweather module to show show only current temperature and weather icon. - Added option `remoteFile` to compliments module to load compliment array from filesystem. +- Added option `roundTemp` for currentweather and weatherforecast modules to display temperatures rounded to nearest integer. ### Updated - Modified translations for Frysk. diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index d7116930..335dc0de 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -65,7 +65,7 @@ The following properties can be configured: - roundTemperature + roundTemp Round temperature value to nearest integer.

Possible values: true (round to integer) or false (display exact value with decimal point)
Default value: false diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 43b57f4f..2d5635af 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -15,7 +15,6 @@ Module.register("currentweather",{ locationID: false, appid: "", units: config.units, - roundTemperature: false, updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, timeFormat: config.timeFormat, @@ -37,7 +36,8 @@ Module.register("currentweather",{ calendarClass: "calendar", onlyTemp: false, - + roundTemp: false, + iconTable: { "01d": "wi-day-sunny", "02d": "wi-day-cloudy", @@ -183,7 +183,7 @@ Module.register("currentweather",{ large.appendChild(weatherIcon); var temp = this.temperature; - if (this.config.roundTemperature) { + if (this.config.roundTemp) { temp = Math.round(temp); } var temperature = document.createElement("span"); diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 8b80e982..0cc3e46b 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -65,7 +65,7 @@ The following properties can be configured: - roundTemperature + roundTemp Round temperature values to nearest integer.

Possible values: true (round to integer) or false (display exact value with decimal point)
Default value: false diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 014e00cd..6eba014a 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -15,7 +15,6 @@ Module.register("weatherforecast",{ locationID: false, appid: "", units: config.units, - roundTemperature: false, maxNumberOfDays: 7, showRainAmount: false, updateInterval: 10 * 60 * 1000, // every 10 minutes @@ -35,6 +34,8 @@ Module.register("weatherforecast",{ appendLocationNameToHeader: true, calendarClass: "calendar", + roundTemp: false, + iconTable: { "01d": "wi-day-sunny", "02d": "wi-day-cloudy", @@ -136,7 +137,7 @@ Module.register("weatherforecast",{ var maxTemp = forecast.maxTemp; var minTemp = forecast.minTemp; - if (this.config.roundTemperature) { + if (this.config.roundTemp) { maxTemp = Math.round(maxTemp); minTemp = Math.round(minTemp); }