-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default for weatherEndpoint according to API 3.0 #3583
Conversation
did't checkout develop. my fault. Sorry.
as weather is all in browser we could log a message there about default lat/lon |
@HeikoGr the tests are failing because the I fixed the merge conflicts in changelog so you should fetch your |
funny, on the module side its "/onecall" |
upsi, I tested this without and test works
we should think about more changes, e.g.
|
remove leading slash
will fail again, now e2e tests, will check why ... |
ok, i will wait for your response |
question: is |
openweather says /onecall is only |
Except for pro customers. This is why i didn‘t remove the other endpoint functions |
but our users are mostly not pro. so does onecall |
so now I know what is happening. First thing Problem is, that if no /**
* Overrides method for setting config to check if endpoint is correct for hourly
* @param {object} config The configuration object
*/
setConfig (config) {
this.config = config;
if (!this.config.weatherEndpoint) {
switch (this.config.type) {
case "hourly":
this.config.weatherEndpoint = "/onecall";
break;
case "daily":
case "forecast":
this.config.weatherEndpoint = "/forecast";
break;
case "current":
this.config.weatherEndpoint = "/weather";
break;
default:
Log.error("weatherEndpoint not configured and could not resolve it based on type");
}
}
}, So with a new default To discuss:
|
we should test without the endpoint set too pick a provider, it should work |
correct, we only test against openweathermap, so the mock data is specific to that provider too. |
Co-authored-by: Pedro Lamas <[email protected]>
update case select of endpoint
@HeikoGr I have a fix for the tests now, is it o.k. to push this on your branch? |
absolutely |
…rEndpoint to all weather test configs
since API 3.0 is default, weatherEndpoint should be set to "/onecall"
Fixes #3574
ATTENTION: since lat / lon defaults to 0 / 0, the weather plugins works after this patch, but shows the weather from https://de.wikipedia.org/wiki/Null_Island if lat / lon is not manually set.