Included check for Met Office DataHub provider.

The new Met Office provider also returns precipitation as a probability percentage.
This commit is contained in:
CreepinJesus 2020-06-28 11:00:10 +01:00 committed by GitHub
parent dd32d3a492
commit 4339cdd8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,7 +208,7 @@ Module.register("weather", {
if (isNaN(value) || value === 0 || value.toFixed(2) === "0.00") { if (isNaN(value) || value === 0 || value.toFixed(2) === "0.00") {
value = ""; value = "";
} else { } else {
if (this.config.weatherProvider === "ukmetoffice") { if (this.config.weatherProvider === "ukmetoffice" || this.config.weatherProvider === "ukmetofficedatahub") {
value += "%"; value += "%";
} else { } else {
value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`;