run lint:prettier

This commit is contained in:
tobias 2022-02-22 11:14:28 +01:00
parent 212e60c12d
commit 4048d79fc5

View File

@ -20,7 +20,7 @@ WeatherProvider.register("weatherflow", {
defaults: {
apiBase: "https://swd.weatherflow.com/swd/rest/",
token: "",
stationid: "",
stationid: ""
},
units: {
@ -28,7 +28,6 @@ WeatherProvider.register("weatherflow", {
metric: "si"
},
fetchCurrentWeather() {
this.fetchData(this.getUrl())
.then((data) => {
@ -40,10 +39,9 @@ WeatherProvider.register("weatherflow", {
currentWeather.windSpeed = data.current_conditions.wind_avg;
currentWeather.windDirection = data.current_conditions.wind_direction;
currentWeather.weatherType = data.forecast.daily[0].icon;
currentWeather.sunrise = moment(data.forecast.daily[0].sunrise), "X";
(currentWeather.sunrise = moment(data.forecast.daily[0].sunrise)), "X";
currentWeather.sunset = moment(data.forecast.daily[0].sunset, "X");
this.setCurrentWeather(currentWeather);
})
.catch(function (request) {
Log.error("Could not load data ... ", request);
@ -56,8 +54,7 @@ WeatherProvider.register("weatherflow", {
.then((data) => {
const days = [];
for(const forecast of data.forecast.daily) {
for (const forecast of data.forecast.daily) {
const weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits, this.config.useKmh);
weather.date = moment(forecast.day_start_local, "X");
@ -66,12 +63,10 @@ WeatherProvider.register("weatherflow", {
weather.weatherType = forecast.icon;
weather.snow = 0;
days.push(weather);
}
this.setWeatherForecast(days);
})
.catch(function (request) {
Log.error("Could not load data ... ", request);
@ -81,6 +76,6 @@ WeatherProvider.register("weatherflow", {
// Create a URL from the config and base URL.
getUrl() {
return this.config.apiBase + "better_forecast?station_id=" + this.config.stationid + "&token=" + this.config.token
return this.config.apiBase + "better_forecast?station_id=" + this.config.stationid + "&token=" + this.config.token;
}
});
});