Skip to content

Commit

Permalink
Make darksky also fetch metric units only
Browse files Browse the repository at this point in the history
  • Loading branch information
veeck committed Aug 19, 2022
1 parent 6544434 commit dc23635
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions modules/default/weather/providers/darksky.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ WeatherProvider.register("darksky", {
lon: 0
},

units: {
imperial: "us",
metric: "si"
},

fetchCurrentWeather() {
this.fetchData(this.getUrl())
.then((data) => {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit dc23635

Please sign in to comment.