diff --git a/CHANGELOG.md b/CHANGELOG.md index 466bae67..f757b0bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - 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 `zoom` to scale the whole mirror display with a given factor. +- 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 35c03404..335dc0de 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -64,6 +64,13 @@ The following properties can be configured:
Default value: config.units + + roundTemp + Round temperature value to nearest integer.
+
Possible values: true (round to integer) or false (display exact value with decimal point) +
Default value: false + + updateInterval How often does the content needs to be fetched? (Milliseconds)
diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index a379332d..ab48b911 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -36,7 +36,8 @@ Module.register("currentweather",{ calendarClass: "calendar", onlyTemp: false, - + roundTemp: false, + iconTable: { "01d": "wi-day-sunny", "02d": "wi-day-cloudy", @@ -385,14 +386,6 @@ Module.register("currentweather",{ return 12; }, - /* function(temperature) - * Rounds a temperature to 1 decimal. - * - * argument temperature number - Temperature. - * - * return number - Rounded Temperature. - */ - deg2Cardinal: function(deg) { if (deg>11.25 && deg<=33.75){ return "NNE"; @@ -429,8 +422,15 @@ Module.register("currentweather",{ } }, - + /* function(temperature) + * Rounds a temperature to 1 decimal or integer (depending on config.roundTemp). + * + * argument temperature number - Temperature. + * + * return number - Rounded Temperature. + */ roundValue: function(temperature) { - return parseFloat(temperature).toFixed(1); + var decimals = this.config.roundTemp ? 0 : 1; + return parseFloat(temperature).toFixed(decimals); } }); diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index 6147c061..b8e58a7d 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -29,7 +29,18 @@ module.exports = NodeHelper.create({ continue; } - simpleGits.push({"module": moduleName, "git": SimpleGit(moduleFolder)}); + var res = function(mn, mf) { + var git = SimpleGit(mf); + git.getRemotes(true, function(err, remotes) { + if (remotes.length < 1 || remotes[0].name.length < 1) { + // No valid remote for folder, skip + return; + } + + // Folder has .git and has at least one git remote, watch this folder + simpleGits.push({"module": mn, "git": git}); + }); + }(moduleName, moduleFolder); } } diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 6b88d21e..0cc3e46b 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -64,6 +64,13 @@ The following properties can be configured:
Default value: config.units + + roundTemp + Round temperature values to nearest integer.
+
Possible values: true (round to integer) or false (display exact value with decimal point) +
Default value: false + + maxNumberOfDays How many days of forecast to return. Specified by config.js
diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 51c3f56e..5078c9b6 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -34,6 +34,8 @@ Module.register("weatherforecast",{ appendLocationNameToHeader: true, calendarClass: "calendar", + roundTemp: false, + iconTable: { "01d": "wi-day-sunny", "02d": "wi-day-cloudy", @@ -342,13 +344,15 @@ Module.register("weatherforecast",{ }, /* function(temperature) - * Rounds a temperature to 1 decimal. + * Rounds a temperature to 1 decimal or integer (depending on config.roundTemp). * * argument temperature number - Temperature. * * return number - Rounded Temperature. */ roundValue: function(temperature) { - return parseFloat(temperature).toFixed(1); + var decimals = this.config.roundTemp ? 0 : 1; + return parseFloat(temperature).toFixed(decimals); } }); +