From be76d5ce9a88138924444a46a129d6a3834f3547 Mon Sep 17 00:00:00 2001 From: rejas Date: Tue, 31 Aug 2021 23:34:22 +0200 Subject: [PATCH] Use new method in smhi provider --- modules/default/weather/providers/smhi.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/default/weather/providers/smhi.js b/modules/default/weather/providers/smhi.js index 5018bdfc..2869906a 100644 --- a/modules/default/weather/providers/smhi.js +++ b/modules/default/weather/providers/smhi.js @@ -109,9 +109,7 @@ WeatherProvider.register("smhi", { let currentWeather = new WeatherObject("metric", "metric", "metric"); currentWeather.date = moment(weatherData.validTime); - let times = SunCalc.getTimes(currentWeather.date.toDate(), coordinates.lat, coordinates.lon); - currentWeather.sunrise = moment(times.sunrise, "X"); - currentWeather.sunset = moment(times.sunset, "X"); + currentWeather.updateSunTime(coordinates.lat, coordinates.lon); currentWeather.humidity = this.paramValue(weatherData, "r"); currentWeather.temperature = this.paramValue(weatherData, "t"); currentWeather.windSpeed = this.paramValue(weatherData, "ws");