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

Get weather based on id rather then name #300

Open
a-waider opened this issue Jan 5, 2025 · 2 comments
Open

Get weather based on id rather then name #300

a-waider opened this issue Jan 5, 2025 · 2 comments

Comments

@a-waider
Copy link

a-waider commented Jan 5, 2025

Hey, the weather widget is lacking a feature for my specific case. The location property in the configuration only supports to query for the first found item of open-meteo.com. However I didn't find a search query which lists my location as the first result.

I would propose to also support location ids which open-meteo.com also provides. The app could first check if the location property is an integer and query by the location id, otherwise query by name.

@svilenmarkov
Copy link
Member

Hey, the location parameter accepts up to 3 comma separated values, where the second value is matched against admin1 in the JSON response. Here's what that would look like for a bunch of US places with the same name:

Greenville, North Carolina, United States
Greenville, South Carolina, United States
Greenville, Mississippi, United States

If admin1 isn't populated for the results you're seeing, please let me know, otherwise I believe this should resolve your issue.

@a-waider
Copy link
Author

a-waider commented Jan 8, 2025

Alright, thanks for your help. I updated it accordingly and it seems to give me plausible values. Honestly I'm still not really sure it's using the correct location. Is there a way to verify which location e.g. by lat/lon or id is used?

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

No branches or pull requests

2 participants