diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 2a6f7844..3df88173 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -106,6 +106,13 @@ The following properties can be configured:
showHumidity
true
or false
+ false
+ useBeaufort
true
or false
diff --git a/modules/default/currentweather/currentweather.css b/modules/default/currentweather/currentweather.css
index 9e9d9ed3..a40be878 100644
--- a/modules/default/currentweather/currentweather.css
+++ b/modules/default/currentweather/currentweather.css
@@ -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;
+}
diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js
index 5265b099..587080db 100644
--- a/modules/default/currentweather/currentweather.js
+++ b/modules/default/currentweather/currentweather.js
@@ -23,6 +23,7 @@ Module.register("currentweather",{
showWindDirection: true,
useBeaufort: true,
lang: config.language,
+ showHumidity: false,
initialLoadDelay: 0, // 0 seconds delay
retryDelay: 2500,
@@ -117,6 +118,7 @@ Module.register("currentweather",{
var small = document.createElement("div");
small.className = "normal medium";
+
var windIcon = document.createElement("span");
windIcon.className = "wi wi-strong-wind dimmed";
small.appendChild(windIcon);
@@ -134,6 +136,18 @@ Module.register("currentweather",{
spacer.innerHTML = " ";
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");
sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon;
small.appendChild(sunriseSunsetIcon);
@@ -142,6 +156,8 @@ Module.register("currentweather",{
sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime;
small.appendChild(sunriseSunsetTime);
+ wrapper.appendChild(small);
+
var large = document.createElement("div");
large.className = "large light";
@@ -154,7 +170,6 @@ Module.register("currentweather",{
temperature.innerHTML = " " + this.temperature + "°";
large.appendChild(temperature);
- wrapper.appendChild(small);
wrapper.appendChild(large);
return wrapper;
},
@@ -224,6 +239,7 @@ Module.register("currentweather",{
return;
}
+ this.humidity = parseFloat(data.main.humidity);
this.temperature = this.roundValue(data.main.temp);
if (this.config.useBeaufort){