fix rain amount information for different units and providers, documentation

This commit is contained in:
fewieden
2018-12-30 20:46:25 +01:00
parent 8dd7621f29
commit de04c12d3c
7 changed files with 150 additions and 18 deletions

View File

@@ -81,7 +81,11 @@ WeatherProvider.register("darksky", {
weather.minTemperature = forecast.temperatureMin;
weather.maxTemperature = forecast.temperatureMax;
weather.weatherType = this.convertWeatherType(forecast.icon);
weather.rain = forecast.precipAccumulation;
if (this.config.units === "metric" && !isNaN(forecast.precipAccumulation)) {
weather.rain = forecast.precipAccumulation * 10;
} else {
weather.rain = forecast.precipAccumulation;
}
days.push(weather);
}