mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 01:26:29 -04:00
refactor: use const
instead of let
This commit is contained in:
parent
6f273d76b3
commit
02cf9b37e2
1 changed files with 7 additions and 7 deletions
|
@ -27,9 +27,9 @@ WeatherProvider.register("smhi", {
|
||||||
fetchCurrentWeather() {
|
fetchCurrentWeather() {
|
||||||
this.fetchData(this.getURL())
|
this.fetchData(this.getURL())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
let closest = this.getClosestToCurrentTime(data.timeSeries);
|
const closest = this.getClosestToCurrentTime(data.timeSeries);
|
||||||
let coordinates = this.resolveCoordinates(data);
|
const coordinates = this.resolveCoordinates(data);
|
||||||
let weatherObject = this.convertWeatherDataToObject(closest, coordinates);
|
const weatherObject = this.convertWeatherDataToObject(closest, coordinates);
|
||||||
this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`);
|
this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`);
|
||||||
this.setCurrentWeather(weatherObject);
|
this.setCurrentWeather(weatherObject);
|
||||||
})
|
})
|
||||||
|
@ -43,8 +43,8 @@ WeatherProvider.register("smhi", {
|
||||||
fetchWeatherForecast() {
|
fetchWeatherForecast() {
|
||||||
this.fetchData(this.getURL())
|
this.fetchData(this.getURL())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
let coordinates = this.resolveCoordinates(data);
|
const coordinates = this.resolveCoordinates(data);
|
||||||
let weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates);
|
const weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates);
|
||||||
this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`);
|
this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`);
|
||||||
this.setWeatherForecast(weatherObjects);
|
this.setWeatherForecast(weatherObjects);
|
||||||
})
|
})
|
||||||
|
@ -58,8 +58,8 @@ WeatherProvider.register("smhi", {
|
||||||
fetchWeatherHourly() {
|
fetchWeatherHourly() {
|
||||||
this.fetchData(this.getURL())
|
this.fetchData(this.getURL())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
let coordinates = this.resolveCoordinates(data);
|
const coordinates = this.resolveCoordinates(data);
|
||||||
let weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates, "hour");
|
const weatherObjects = this.convertWeatherDataGroupedBy(data.timeSeries, coordinates, "hour");
|
||||||
this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`);
|
this.setFetchedLocation(this.config.location || `(${coordinates.lat},${coordinates.lon})`);
|
||||||
this.setWeatherHourly(weatherObjects);
|
this.setWeatherHourly(weatherObjects);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue