Refactor common weather methods into utils class (#2958)

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2022-10-28 19:56:55 +02:00
committed by GitHub
parent dde88601a6
commit c191ff0032
9 changed files with 133 additions and 114 deletions

View File

@@ -1,4 +1,4 @@
/* global WeatherProvider, WeatherObject */
/* global WeatherProvider, WeatherObject, WeatherUtils */
/* MagicMirror²
* Module: Weather
@@ -101,8 +101,8 @@ WeatherProvider.register("ukmetoffice", {
currentWeather.temperature = rep.T;
currentWeather.feelsLikeTemp = rep.F;
currentWeather.precipitation = parseInt(rep.Pp);
currentWeather.windSpeed = currentWeather.convertWindToMetric(rep.S);
currentWeather.windDirection = currentWeather.valueWindDirection(rep.D);
currentWeather.windSpeed = WeatherUtils.convertWindToMetric(rep.S);
currentWeather.windDirection = WeatherUtils.convertWindDirection(rep.D);
currentWeather.weatherType = this.convertWeatherType(rep.W);
}
}