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
@@ -163,7 +163,7 @@ WeatherProvider.register("envcanada", {
currentWeather.temperature = this.cacheCurrentTemp;
}
currentWeather.windSpeed = currentWeather.convertWindToMs(ECdoc.querySelector("siteData currentConditions wind speed").textContent);
currentWeather.windSpeed = WeatherUtils.convertWindToMs(ECdoc.querySelector("siteData currentConditions wind speed").textContent);
currentWeather.windDirection = ECdoc.querySelector("siteData currentConditions wind bearing").textContent;