mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 13:09:34 +00:00
Show Scale of Temperature if config flag is set
This commit is contained in:
parent
8a101f9e9a
commit
5e573ca980
@ -24,6 +24,7 @@ Module.register("weatherforecast",{
|
|||||||
fade: true,
|
fade: true,
|
||||||
fadePoint: 0.25, // Start on 1/4th of the list.
|
fadePoint: 0.25, // Start on 1/4th of the list.
|
||||||
colored: false,
|
colored: false,
|
||||||
|
scale: false, // "C" or "F"
|
||||||
|
|
||||||
initialLoadDelay: 2500, // 2.5 seconds delay. This delay is used to keep the OpenWeather API happy.
|
initialLoadDelay: 2500, // 2.5 seconds delay. This delay is used to keep the OpenWeather API happy.
|
||||||
retryDelay: 2500,
|
retryDelay: 2500,
|
||||||
@ -141,11 +142,25 @@ Module.register("weatherforecast",{
|
|||||||
|
|
||||||
var maxTempCell = document.createElement("td");
|
var maxTempCell = document.createElement("td");
|
||||||
maxTempCell.innerHTML = forecast.maxTemp;
|
maxTempCell.innerHTML = forecast.maxTemp;
|
||||||
|
if (this.config.scale == "C" || this.config.scale == "c") {
|
||||||
|
maxTempCell.innerHTML += " °C";
|
||||||
|
} else {
|
||||||
|
if (this.config.scale == "F" || this.config.scale == "f") {
|
||||||
|
maxTempCell.innerHTML += " °F";
|
||||||
|
}
|
||||||
|
}
|
||||||
maxTempCell.className = "align-right bright max-temp";
|
maxTempCell.className = "align-right bright max-temp";
|
||||||
row.appendChild(maxTempCell);
|
row.appendChild(maxTempCell);
|
||||||
|
|
||||||
var minTempCell = document.createElement("td");
|
var minTempCell = document.createElement("td");
|
||||||
minTempCell.innerHTML = forecast.minTemp;
|
minTempCell.innerHTML = forecast.minTemp;
|
||||||
|
if (scale == "C" || scale == "c") {
|
||||||
|
minTempCell.innerHTML += " °C";
|
||||||
|
} else {
|
||||||
|
if (scale == "F" || scale == "f") {
|
||||||
|
minTempCell.innerHTML += " °F";
|
||||||
|
}
|
||||||
|
}
|
||||||
minTempCell.className = "align-right min-temp";
|
minTempCell.className = "align-right min-temp";
|
||||||
row.appendChild(minTempCell);
|
row.appendChild(minTempCell);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user