Merge branch 'develop' into electron-zoom-factor

This commit is contained in:
Olexandr Savchuk 2016-12-08 15:54:52 +01:00
commit 15c5725829
6 changed files with 44 additions and 14 deletions

View File

@ -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 `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 `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 `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 ### Updated
- Modified translations for Frysk. - Modified translations for Frysk.

View File

@ -64,6 +64,13 @@ The following properties can be configured:
<br><b>Default value:</b> <code>config.units</code> <br><b>Default value:</b> <code>config.units</code>
</td> </td>
</tr> </tr>
<tr>
<td><code>roundTemp</code></td>
<td>Round temperature value to nearest integer.<br>
<br><b>Possible values:</b> <code>true</code> (round to integer) or <code>false</code> (display exact value with decimal point)
<br><b>Default value:</b> <code>false</code>
</td>
</tr>
<tr> <tr>
<td><code>updateInterval</code></td> <td><code>updateInterval</code></td>
<td>How often does the content needs to be fetched? (Milliseconds)<br> <td>How often does the content needs to be fetched? (Milliseconds)<br>

View File

@ -36,6 +36,7 @@ Module.register("currentweather",{
calendarClass: "calendar", calendarClass: "calendar",
onlyTemp: false, onlyTemp: false,
roundTemp: false,
iconTable: { iconTable: {
"01d": "wi-day-sunny", "01d": "wi-day-sunny",
@ -385,14 +386,6 @@ Module.register("currentweather",{
return 12; return 12;
}, },
/* function(temperature)
* Rounds a temperature to 1 decimal.
*
* argument temperature number - Temperature.
*
* return number - Rounded Temperature.
*/
deg2Cardinal: function(deg) { deg2Cardinal: function(deg) {
if (deg>11.25 && deg<=33.75){ if (deg>11.25 && deg<=33.75){
return "NNE"; 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) { roundValue: function(temperature) {
return parseFloat(temperature).toFixed(1); var decimals = this.config.roundTemp ? 0 : 1;
return parseFloat(temperature).toFixed(decimals);
} }
}); });

View File

@ -29,7 +29,18 @@ module.exports = NodeHelper.create({
continue; 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);
} }
} }

View File

@ -64,6 +64,13 @@ The following properties can be configured:
<br><b>Default value:</b> <code>config.units</code> <br><b>Default value:</b> <code>config.units</code>
</td> </td>
</tr> </tr>
<tr>
<td><code>roundTemp</code></td>
<td>Round temperature values to nearest integer.<br>
<br><b>Possible values:</b> <code>true</code> (round to integer) or <code>false</code> (display exact value with decimal point)
<br><b>Default value:</b> <code>false</code>
</td>
</tr>
<tr> <tr>
<td><code>maxNumberOfDays</code></td> <td><code>maxNumberOfDays</code></td>
<td>How many days of forecast to return. Specified by config.js<br> <td>How many days of forecast to return. Specified by config.js<br>

View File

@ -34,6 +34,8 @@ Module.register("weatherforecast",{
appendLocationNameToHeader: true, appendLocationNameToHeader: true,
calendarClass: "calendar", calendarClass: "calendar",
roundTemp: false,
iconTable: { iconTable: {
"01d": "wi-day-sunny", "01d": "wi-day-sunny",
"02d": "wi-day-cloudy", "02d": "wi-day-cloudy",
@ -342,13 +344,15 @@ Module.register("weatherforecast",{
}, },
/* function(temperature) /* function(temperature)
* Rounds a temperature to 1 decimal. * Rounds a temperature to 1 decimal or integer (depending on config.roundTemp).
* *
* argument temperature number - Temperature. * argument temperature number - Temperature.
* *
* return number - Rounded Temperature. * return number - Rounded Temperature.
*/ */
roundValue: function(temperature) { roundValue: function(temperature) {
return parseFloat(temperature).toFixed(1); var decimals = this.config.roundTemp ? 0 : 1;
return parseFloat(temperature).toFixed(decimals);
} }
}); });