mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Add ability for currentweather
module to display indoor humidity via INDOOR_HUMIDITY notification
This commit is contained in:
parent
45d289a65e
commit
2c6ecaab5b
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user