Skip to content

Commit

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

units: {
imperial: "I",
metric: "M"
},

fetchedLocation: function () {
return this.fetchedLocationName || "";
},
Expand Down Expand Up @@ -71,8 +66,7 @@ WeatherProvider.register("weatherbit", {

// 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}?lat=${this.config.lat}&lon=${this.config.lon}&units=${units}&key=${this.config.apiKey}`;
return `${this.config.apiBase}${this.config.weatherEndpoint}?lat=${this.config.lat}&lon=${this.config.lon}&units=M&key=${this.config.apiKey}`;
},

// Implement WeatherDay generator.
Expand Down

0 comments on commit 6f0ea52

Please sign in to comment.