weather module adjustments for rain and snow

This commit is contained in:
vincep5
2019-02-14 13:00:40 -06:00
parent 40101129b5
commit cbe4d2cd7f
9 changed files with 58 additions and 22 deletions

View File

@@ -49,7 +49,7 @@ Module.register("weather",{
tableClass: "small",
onlyTemp: false,
showRainAmount: true,
showPrecipitationAmount: false,
colored: false,
showFeelsLike: true
},
@@ -200,8 +200,8 @@ Module.register("weather",{
value += "K";
}
}
} else if (type === "rain") {
if (isNaN(value) || value === 0) {
} else if (type === "precip") {
if (isNaN(value) || value === 0 || value.toFixed(2) === "0.00") {
value = "";
} else {
value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`;