diff --git a/CHANGELOG.md b/CHANGELOG.md index e44d591c..fcd75ab3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add test default modules present modules/default/defaultmodules.js. - Add unit test calendar_modules function capFirst. - Add test for check if exits the directories present in defaults modules. +- Add ability for `currentweather` module to display indoor temperature via INDOOR_TEMPERATURE notification ### Updated - Added missing keys to Polish translation. diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index d70ec297..a01d6d86 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -41,6 +41,7 @@ The following properties can be configured: | `showPeriodUpper` | Show the period (AM/PM) with 12 hour format as uppercase

**Possible values:** `true` or `false`
**Default value:** `false` | `showWindDirection` | Show the wind direction next to the wind speed.

**Possible values:** `true` or `false`
**Default value:** `true` | `showHumidity` | Show the current humidity

**Possible values:** `true` or `false`
**Default value:** `false` +| `showIndoorTemperature` | If you have another module that emits the INDOOR_TEMPERATURE notification, the indoor temperature will be displayed
**Default value:** `false` | `onlyTemp` | Show only current Temperature and weather icon.

**Possible values:** `true` or `false`
**Default value:** `false` | `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units.

**Possible values:** `true` or `false`
**Default value:** `true` | `lang` | The language of the days.

**Possible values:** `en`, `nl`, `ru`, etc ...
**Default value:** uses value of _config.language_ diff --git a/modules/default/currentweather/currentweather.css b/modules/default/currentweather/currentweather.css index a40be878..b7669bda 100644 --- a/modules/default/currentweather/currentweather.css +++ b/modules/default/currentweather/currentweather.css @@ -1,4 +1,5 @@ -.currentweather .weathericon { +.currentweather .weathericon, +.currentweather .fa-home { font-size: 75%; line-height: 65px; display: inline-block; diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 6e23cdcf..4a73dc51 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -25,6 +25,7 @@ Module.register("currentweather",{ lang: config.language, showHumidity: false, degreeLabel: false, + showIndoorTemperature: false, initialLoadDelay: 0, // 0 seconds delay retryDelay: 2500, @@ -97,6 +98,7 @@ Module.register("currentweather",{ this.sunriseSunsetTime = null; this.sunriseSunsetIcon = null; this.temperature = null; + this.indoorTemperature = null; this.weatherType = null; this.loaded = false; @@ -203,6 +205,17 @@ Module.register("currentweather",{ temperature.innerHTML = " " + this.temperature + "°" + degreeLabel; large.appendChild(temperature); + if (this.config.showIndoorTemperature && this.indoorTemperature) { + var indoorIcon = document.createElement("span"); + indoorIcon.className = "fa fa-home"; + large.appendChild(indoorIcon); + + var indoorTemperatureElem = document.createElement("span"); + indoorTemperatureElem.className = "bright"; + indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel; + large.appendChild(indoorTemperatureElem); + } + wrapper.appendChild(large); return wrapper; }, @@ -239,6 +252,10 @@ Module.register("currentweather",{ } } } + if (notification === "INDOOR_TEMPERATURE") { + this.indoorTemperature = this.roundValue(payload); + this.updateDom(self.config.animationSpeed); + } }, /* updateWeather(compliments)