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");