From 02cf9b37e23eee624b5b39383195d26c7aa6c9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hallstr=C3=B6m?= Date: Mon, 29 Aug 2022 20:08:27 +0200 Subject: [PATCH] refactor: use `const` instead of `let` --- modules/default/weather/providers/smhi.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/default/weather/providers/smhi.js b/modules/default/weather/providers/smhi.js index ce5ac772..faa5d196 100644 --- a/modules/default/weather/providers/smhi.js +++ b/modules/default/weather/providers/smhi.js @@ -27,9 +27,9 @@ WeatherProvider.register("smhi", { fetchCurrentWeather() { this.fetchData(this.getURL()) .then((data) => { - let closest = this.getClosestToCurrentTime(data.timeSeries); - let coordinates = this.resolveCoordinates(data); - let weatherObject = this.convertWeatherDataToObject(closest, coordinates); + const closest = this.getClosestToCurrentTime(data.timeSeries); + const coordinates = this.resolveCoordinates(data); + const weatherObject = this.convertWeatherDataToObject(closest, coordinates); this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`); this.setCurrentWeather(weatherObject); }) @@ -43,8 +43,8 @@ WeatherProvider.register("smhi", { fetchWeatherForecast() { this.fetchData(this.getURL()) .then((data) => { - let coordinates = this.resolveCoordinates(data); - let weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates); + const coordinates = this.resolveCoordinates(data); + const weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates); this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`); this.setWeatherForecast(weatherObjects); }) @@ -58,8 +58,8 @@ WeatherProvider.register("smhi", { fetchWeatherHourly() { this.fetchData(this.getURL()) .then((data) => { - let coordinates = this.resolveCoordinates(data); - let weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates, "hour"); + const coordinates = this.resolveCoordinates(data); + const weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates, "hour"); this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`); this.setWeatherHourly(weatherObjects); })