Skip to content
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

weather module, weatherbit provider doesn't use type to set the endpoint, forces user.. #2899

Closed
sdetweil opened this issue Aug 15, 2022 · 11 comments · Fixed by #2900
Closed

Comments

@sdetweil
Copy link
Collaborator

all in title

		{
			module: "weather",
			position: "top_right",
			header: "Weather Forecast",
			config: {
				updateInterval: 15*1000,
				initialLoadDelay: 2,

				weatherProvider: "weatherbit",
				weatherEndpoint:"/forecast/daily",  // < --- leave this off and module doesn't work , isn't that what type is supposed to FIX..
				type: "forecast",   // <--  but provider doesn't use this 'required' parm..
				lat: 30.4548443,
				lon: -97.6222674,
				apiKey: "",
			}
		},
@rejas
Copy link
Collaborator

rejas commented Aug 16, 2022

yeah, seems wrong to not use the "type" param which is used in other modules and specifically mentioned in the docs.

openweathermap has both params too but only uses the type only when weatherEndpoint is not specified.

maybe switch the usage in this module to that of openweathermap?

@sdetweil
Copy link
Collaborator Author

yeh, i did local change to use type.. will fix to override that with the actual endpoint.. but how do you tell user specified ? cause its a default value.. in the provider

	defaults: {
		apiBase: "https://api.weatherbit.io/v2.0",
		weatherEndpoint: "/current",

this.config.weatherEndpoint != this.defaults.weatherEndpoint

@rejas
Copy link
Collaborator

rejas commented Aug 17, 2022

With my PR the weatherEndpoint is only used if explicitly set in the config, and not per default. That way existing configs still function (if at all) but new users can rely on the type value to work.

@rejas
Copy link
Collaborator

rejas commented Aug 17, 2022

Looking at the code of other providers it seems that at least darksky should have the same problem...

@khassel
Copy link
Collaborator

khassel commented Aug 17, 2022

Looking at the code of other providers it seems that at least darksky should have the same problem...

I think we shouldn't investigate in this because "The Dark Sky API and website will continue to function until March 31st, 2023".

Source: https://blog.darksky.net/

@sdetweil
Copy link
Collaborator Author

@khassel I think u meant invest (spend energy).

it's a tiny thing, for consistency sake

@khassel
Copy link
Collaborator

khassel commented Aug 18, 2022

thanks, yes ...

@rejas
Copy link
Collaborator

rejas commented Aug 18, 2022

It might be tiny, but I still would like to test it before commiting any change. So without any darksky credentials I wont be able to do it.

@sdetweil
Copy link
Collaborator Author

send an email to my userid at gmail and I will send my key

@rejas
Copy link
Collaborator

rejas commented Aug 18, 2022

Thx for the key, fixed the metric stuff in my WeatherUnitCleanup-PR but somehow darksky seems ok with the "normal" config (type), can you confirm?

@sdetweil
Copy link
Collaborator Author

yes, darksky worked with type and weatherProvider no other settings
both types worked..

@sdetweil sdetweil changed the title weather module, weatherbit provider doesn't use type to set the endpooint, forces user.. weather module, weatherbit provider doesn't use type to set the endpoint, forces user.. Aug 19, 2022
@sdetweil sdetweil closed this as completed Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants