From 2c6ecaab5b613b4b601bdcd89b5d5ac036f86d0c Mon Sep 17 00:00:00 2001 From: Ricardo Gonzalez Date: Sun, 23 Jul 2017 23:55:32 +0100 Subject: [PATCH 1/2] Add ability for `currentweather` module to display indoor humidity via INDOOR_HUMIDITY notification --- CHANGELOG.md | 2 ++ .../default/currentweather/currentweather.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d25af7db..714b7c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed ### Added +- Add ability for `currentweather` module to display indoor humidity via INDOOR_HUMIDITY notification + ### Updated ### Fixed diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index f56dbde1..702c67d8 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -27,6 +27,7 @@ Module.register("currentweather",{ showHumidity: false, degreeLabel: false, showIndoorTemperature: false, + showIndoorHumidity: false, initialLoadDelay: 0, // 0 seconds delay retryDelay: 2500, @@ -101,6 +102,7 @@ Module.register("currentweather",{ this.sunriseSunsetIcon = null; this.temperature = null; this.indoorTemperature = null; + this.indoorHumidity = null; this.weatherType = null; this.loaded = false; @@ -223,6 +225,17 @@ Module.register("currentweather",{ large.appendChild(indoorTemperatureElem); } + if (this.config.showIndoorHumidity && this.indoorHumidity) { + var indoorHumidityIcon = document.createElement("span"); + indoorHumidityIcon.className = "fa fa-tint"; + large.appendChild(indoorHumidityIcon); + + var indoorHumidityElem = document.createElement("span"); + indoorHumidityElem.className = "bright"; + indoorHumidityElem.innerHTML = " " + this.indoorHumidity + "%"; + large.appendChild(indoorHumidityElem); + } + wrapper.appendChild(large); return wrapper; }, @@ -262,6 +275,10 @@ Module.register("currentweather",{ this.indoorTemperature = this.roundValue(payload); this.updateDom(self.config.animationSpeed); } + if (notification === "INDOOR_HUMIDITY") { + this.indoorHumidity = this.roundValue(payload); + this.updateDom(self.config.animationSpeed); + } }, /* updateWeather(compliments) From 7f768059e670afbf4ab0f3cac306ec7212303f03 Mon Sep 17 00:00:00 2001 From: Ricardo Gonzalez Date: Sun, 17 Sep 2017 16:33:23 +0100 Subject: [PATCH 2/2] Update README --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1543d067..d1da4fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add test e2e showWeek feature in spanish language. - Add warning Log when is used old authentication method in the calendar module. - Add test e2e for helloworld module with default config text +- Add ability for `currentweather` module to display indoor humidity via INDOOR_HUMIDITY notification ### Updated - Changed 'default.js' - listen on all attached interfaces by default.