Skip to content

Commit

Permalink
Merge pull request #1025 from ryck/feature/indoorHumidity
Browse files Browse the repository at this point in the history
Feature/indoor humidity
  • Loading branch information
MichMich authored Sep 20, 2017
2 parents 710ab44 + 7f76805 commit 5e51a43
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 17 additions & 0 deletions modules/default/currentweather/currentweather.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Module.register("currentweather",{
showHumidity: false,
degreeLabel: false,
showIndoorTemperature: false,
showIndoorHumidity: false,

initialLoadDelay: 0, // 0 seconds delay
retryDelay: 2500,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5e51a43

Please sign in to comment.