Inline some functions

This commit is contained in:
veeck 2021-09-02 20:37:41 +02:00
parent 9ee11654a6
commit a7756cec13
3 changed files with 3 additions and 8 deletions

View File

@ -164,9 +164,7 @@ WeatherProvider.register("envcanada", {
// CORS errors when accessing EC // CORS errors when accessing EC
// //
getUrl() { getUrl() {
const path = "https://thingproxy.freeboard.io/fetch/https://dd.weather.gc.ca/citypage_weather/xml/" + this.config.provCode + "/" + this.config.siteCode + "_e.xml"; return "https://thingproxy.freeboard.io/fetch/https://dd.weather.gc.ca/citypage_weather/xml/" + this.config.provCode + "/" + this.config.siteCode + "_e.xml";
return path;
}, },
// //

View File

@ -71,13 +71,11 @@ WeatherProvider.register("ukmetofficedatahub", {
// For DataHub requests, the API key/secret are sent in the headers rather than as query strings. // For DataHub requests, the API key/secret are sent in the headers rather than as query strings.
// Headers defined according to Data Hub API (https://metoffice.apiconnect.ibmcloud.com/metoffice/production/api) // Headers defined according to Data Hub API (https://metoffice.apiconnect.ibmcloud.com/metoffice/production/api)
getHeaders() { getHeaders() {
let headers = { return {
accept: "application/json", accept: "application/json",
"x-ibm-client-id": this.config.apiKey, "x-ibm-client-id": this.config.apiKey,
"x-ibm-client-secret": this.config.apiSecret "x-ibm-client-secret": this.config.apiSecret
}; };
return headers;
}, },
// Fetch data using supplied URL and request headers // Fetch data using supplied URL and request headers

View File

@ -90,8 +90,7 @@ class WeatherObject {
} }
kmhWindSpeed() { kmhWindSpeed() {
const windInKmh = this.windUnits === "imperial" ? this.windSpeed * 1.609344 : (this.windSpeed * 60 * 60) / 1000; return this.windUnits === "imperial" ? this.windSpeed * 1.609344 : (this.windSpeed * 60 * 60) / 1000;
return windInKmh;
} }
nextSunAction() { nextSunAction() {