Merge pull request #316 from robinschneider/apikey

Fixes apikey inconsistency
This commit is contained in:
Bastien Wirtz 2021-10-25 13:17:30 -07:00 committed by GitHub
commit b7480f632e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -43,7 +43,7 @@ The following configuration is available for the OpenWeatherMap service:
- name: "Weather"
location: "Amsterdam" # your location.
locationId: "2759794" # Optional: Specify OpenWeatherMap city ID for better accuracy
apiKey: "<---insert-api-key-here--->" # insert your own API key here. Request one from https://openweathermap.org/api.
apikey: "<---insert-api-key-here--->" # insert your own API key here. Request one from https://openweathermap.org/api.
units: "metric" # units to display temperature. Can be one of: metric, imperial, kelvin. Defaults to kelvin.
background: "square" # choose which type of background you want behind the image. Can be one of: square, cicle, none. Defaults to none.
type: "OpenWeather"

View File

@ -64,7 +64,8 @@ export default {
locationQuery = `q=${this.item.location}`;
}
const url = `https://api.openweathermap.org/data/2.5/weather?${locationQuery}&appid=${this.item.apiKey}&units=${this.item.units}`;
const apiKey = this.item.apikey || this.item.apiKey;
const url = `https://api.openweathermap.org/data/2.5/weather?${locationQuery}&appid=${apiKey}&units=${this.item.units}`;
fetch(url)
.then((response) => {
if (!response.ok) {