From dc23635a6ef53b283361d90d74ab21c7d651d2cc Mon Sep 17 00:00:00 2001 From: veeck Date: Thu, 18 Aug 2022 23:25:40 +0200 Subject: [PATCH] Make darksky also fetch metric units only --- modules/default/weather/providers/darksky.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/default/weather/providers/darksky.js b/modules/default/weather/providers/darksky.js index b5bf20e3b2..cb0247a567 100644 --- a/modules/default/weather/providers/darksky.js +++ b/modules/default/weather/providers/darksky.js @@ -26,11 +26,6 @@ WeatherProvider.register("darksky", { lon: 0 }, - units: { - imperial: "us", - metric: "si" - }, - fetchCurrentWeather() { this.fetchData(this.getUrl()) .then((data) => { @@ -67,8 +62,7 @@ WeatherProvider.register("darksky", { // Create a URL from the config and base URL. getUrl() { - const units = this.units[this.config.units] || "auto"; - return `${this.config.apiBase}${this.config.weatherEndpoint}/${this.config.apiKey}/${this.config.lat},${this.config.lon}?units=${units}&lang=${this.config.lang}`; + return `${this.config.apiBase}${this.config.weatherEndpoint}/${this.config.apiKey}/${this.config.lat},${this.config.lon}?units=si&lang=${this.config.lang}`; }, // Implement WeatherDay generator.