mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
Merge branch 'amcolash-current_humidity' into develop
This commit is contained in:
commit
4c03f39437
@ -105,6 +105,13 @@ The following properties can be configured:
|
|||||||
<br><b>Default value:</b> <code>true</code>
|
<br><b>Default value:</b> <code>true</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>showHumidity</code></td>
|
||||||
|
<td>Show the current humidity<br>
|
||||||
|
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
||||||
|
<br><b>Default value:</b> <code>false</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>useBeaufort</code></td>
|
<td><code>useBeaufort</code></td>
|
||||||
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
||||||
|
@ -6,3 +6,11 @@
|
|||||||
-webkit-transform: translate(0, -3px); /* Safari */
|
-webkit-transform: translate(0, -3px); /* Safari */
|
||||||
transform: translate(0, -3px);
|
transform: translate(0, -3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.currentweather .humidityIcon {
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currentweather .humidity-padding {
|
||||||
|
padding-bottom: 6px;
|
||||||
|
}
|
||||||
|
@ -23,6 +23,7 @@ Module.register("currentweather",{
|
|||||||
showWindDirection: true,
|
showWindDirection: true,
|
||||||
useBeaufort: true,
|
useBeaufort: true,
|
||||||
lang: config.language,
|
lang: config.language,
|
||||||
|
showHumidity: false,
|
||||||
|
|
||||||
initialLoadDelay: 0, // 0 seconds delay
|
initialLoadDelay: 0, // 0 seconds delay
|
||||||
retryDelay: 2500,
|
retryDelay: 2500,
|
||||||
@ -117,6 +118,7 @@ Module.register("currentweather",{
|
|||||||
var small = document.createElement("div");
|
var small = document.createElement("div");
|
||||||
small.className = "normal medium";
|
small.className = "normal medium";
|
||||||
|
|
||||||
|
|
||||||
var windIcon = document.createElement("span");
|
var windIcon = document.createElement("span");
|
||||||
windIcon.className = "wi wi-strong-wind dimmed";
|
windIcon.className = "wi wi-strong-wind dimmed";
|
||||||
small.appendChild(windIcon);
|
small.appendChild(windIcon);
|
||||||
@ -134,6 +136,18 @@ Module.register("currentweather",{
|
|||||||
spacer.innerHTML = " ";
|
spacer.innerHTML = " ";
|
||||||
small.appendChild(spacer);
|
small.appendChild(spacer);
|
||||||
|
|
||||||
|
if (this.config.showHumidity) {
|
||||||
|
var humidity = document.createElement("span");
|
||||||
|
humidity.innerHTML = this.humidity;
|
||||||
|
|
||||||
|
var humidityIcon = document.createElement("sup");
|
||||||
|
humidityIcon.className = "wi wi-humidity humidityIcon";
|
||||||
|
humidityIcon.innerHTML = " ";
|
||||||
|
|
||||||
|
small.appendChild(humidity);
|
||||||
|
small.appendChild(humidityIcon);
|
||||||
|
}
|
||||||
|
|
||||||
var sunriseSunsetIcon = document.createElement("span");
|
var sunriseSunsetIcon = document.createElement("span");
|
||||||
sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon;
|
sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon;
|
||||||
small.appendChild(sunriseSunsetIcon);
|
small.appendChild(sunriseSunsetIcon);
|
||||||
@ -142,6 +156,8 @@ Module.register("currentweather",{
|
|||||||
sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime;
|
sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime;
|
||||||
small.appendChild(sunriseSunsetTime);
|
small.appendChild(sunriseSunsetTime);
|
||||||
|
|
||||||
|
wrapper.appendChild(small);
|
||||||
|
|
||||||
var large = document.createElement("div");
|
var large = document.createElement("div");
|
||||||
large.className = "large light";
|
large.className = "large light";
|
||||||
|
|
||||||
@ -154,7 +170,6 @@ Module.register("currentweather",{
|
|||||||
temperature.innerHTML = " " + this.temperature + "°";
|
temperature.innerHTML = " " + this.temperature + "°";
|
||||||
large.appendChild(temperature);
|
large.appendChild(temperature);
|
||||||
|
|
||||||
wrapper.appendChild(small);
|
|
||||||
wrapper.appendChild(large);
|
wrapper.appendChild(large);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
},
|
},
|
||||||
@ -224,6 +239,7 @@ Module.register("currentweather",{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.humidity = parseFloat(data.main.humidity);
|
||||||
this.temperature = this.roundValue(data.main.temp);
|
this.temperature = this.roundValue(data.main.temp);
|
||||||
|
|
||||||
if (this.config.useBeaufort){
|
if (this.config.useBeaufort){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user