mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Merge branch 'current_humidity' of https://github.com/amcolash/MagicMirror into amcolash-current_humidity
This commit is contained in:
@@ -106,6 +106,13 @@ The following properties can be configured:
|
||||
</td>
|
||||
</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>
|
||||
<td><code>useBeaufort</code></td>
|
||||
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
||||
|
@@ -6,3 +6,11 @@
|
||||
-webkit-transform: translate(0, -3px); /* Safari */
|
||||
transform: translate(0, -3px);
|
||||
}
|
||||
|
||||
.currentweather .humidityIcon {
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.currentweather .humidity-padding {
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ Module.register("currentweather",{
|
||||
showWindDirection: true,
|
||||
useBeaufort: true,
|
||||
lang: config.language,
|
||||
showHumidity: false,
|
||||
|
||||
initialLoadDelay: 0, // 0 seconds delay
|
||||
retryDelay: 2500,
|
||||
@@ -142,6 +143,26 @@ Module.register("currentweather",{
|
||||
sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime;
|
||||
small.appendChild(sunriseSunsetTime);
|
||||
|
||||
wrapper.appendChild(small);
|
||||
|
||||
if (this.config.showHumidity) {
|
||||
var middle = document.createElement("div");
|
||||
middle.className = "normal small humidity-padding";
|
||||
|
||||
var humidityIcon = document.createElement("span");
|
||||
humidityIcon.className = "wi wi-humidity humidityIcon";
|
||||
small.appendChild(sunriseSunsetIcon);
|
||||
|
||||
var humidity = document.createElement("span");
|
||||
humidity.innerHTML = this.humidity + "%";
|
||||
var br = document.createElement("br");
|
||||
|
||||
middle.appendChild(humidityIcon);
|
||||
middle.appendChild(humidity);
|
||||
middle.appendChild(br);
|
||||
wrapper.appendChild(middle);
|
||||
}
|
||||
|
||||
var large = document.createElement("div");
|
||||
large.className = "large light";
|
||||
|
||||
@@ -154,7 +175,6 @@ Module.register("currentweather",{
|
||||
temperature.innerHTML = " " + this.temperature + "°";
|
||||
large.appendChild(temperature);
|
||||
|
||||
wrapper.appendChild(small);
|
||||
wrapper.appendChild(large);
|
||||
return wrapper;
|
||||
},
|
||||
@@ -224,6 +244,7 @@ Module.register("currentweather",{
|
||||
return;
|
||||
}
|
||||
|
||||
this.humidity = parseFloat(data.main.humidity);
|
||||
this.temperature = this.roundValue(data.main.temp);
|
||||
|
||||
if (this.config.useBeaufort){
|
||||
|
Reference in New Issue
Block a user