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

[Feature Request] Add automatic location support for weather wiget #48

Closed
Aidan-B opened this issue Sep 4, 2022 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@Aidan-B
Copy link

Aidan-B commented Sep 4, 2022

Sometimes I may travel or not be local to my homeserver. I would like the weather widget to function for my current location in these situations.
I imagine this could look something like an "automatic location" config parameter that makes use of getCurrentPosition() to ask the user for their location before making a query for the weather.
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition

@benphelps
Copy link
Member

What a great idea! I'll see about getting this added.

@benphelps benphelps changed the title Feature Request: Add automatic location support for weather wiget [Feature Request] Add automatic location support for weather wiget Sep 5, 2022
@benphelps benphelps added the enhancement New feature or request label Sep 6, 2022
@benphelps
Copy link
Member

benphelps commented Sep 9, 2022

This has been implemented in the latest commit, with some caveats.

The Geolocation API forcefully requires a secure context (HTTP), so this can only be used if you've got an SSL setup. It also requires a user interaction event, and cannot (should not) be pulled automatically, while we still attempt an automatic grab, it's not guaranteed.

This is what the prompt looks like:

Screenshot 2022-09-09 at 12 48 43 PM

You can find updated documentation here: https://github.com/benphelps/homepage/wiki/Information-Widgets#weatherapi

Copy link
Contributor

github-actions bot commented Feb 6, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants