Update currentweather to support indoor temperature

This commit is contained in:
Jason York
2017-04-30 17:51:10 -05:00
parent 88a01d39ee
commit 0036ec2214
4 changed files with 21 additions and 1 deletions

View File

@@ -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)