mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 13:09:26 +00:00
implemented roundTemperature in weather modules
This commit is contained in:
@@ -15,6 +15,7 @@ Module.register("weatherforecast",{
|
||||
locationID: false,
|
||||
appid: "",
|
||||
units: config.units,
|
||||
roundTemperature: false,
|
||||
maxNumberOfDays: 7,
|
||||
showRainAmount: false,
|
||||
updateInterval: 10 * 60 * 1000, // every 10 minutes
|
||||
@@ -133,13 +134,20 @@ Module.register("weatherforecast",{
|
||||
icon.className = "wi weathericon " + forecast.icon;
|
||||
iconCell.appendChild(icon);
|
||||
|
||||
var maxTemp = forecast.maxTemp;
|
||||
var minTemp = forecast.minTemp;
|
||||
if (this.config.roundTemperature) {
|
||||
maxTemp = Math.round(maxTemp);
|
||||
minTemp = Math.round(minTemp);
|
||||
}
|
||||
|
||||
var maxTempCell = document.createElement("td");
|
||||
maxTempCell.innerHTML = forecast.maxTemp;
|
||||
maxTempCell.innerHTML = maxTemp;
|
||||
maxTempCell.className = "align-right bright max-temp";
|
||||
row.appendChild(maxTempCell);
|
||||
|
||||
var minTempCell = document.createElement("td");
|
||||
minTempCell.innerHTML = forecast.minTemp;
|
||||
minTempCell.innerHTML = minTemp;
|
||||
minTempCell.className = "align-right min-temp";
|
||||
row.appendChild(minTempCell);
|
||||
|
||||
@@ -352,3 +360,4 @@ Module.register("weatherforecast",{
|
||||
return parseFloat(temperature).toFixed(1);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user