Kvaesitso icon indicating copy to clipboard operation
Kvaesitso copied to clipboard

[Feature Request] Add PirateWeather Weather Provider

Open apederson94 opened this issue 2 years ago • 7 comments

I'd love to be able to use Pirate Weather as a weather source. I plan to do all that work myself, but I have questions about the feasibility of this.

The free tier API key is only 10k requests/month. This is probably not enough given what I read in #228. There are higher tiers that can be paid for, but I find it highly unlikely that @MM2-0 will want to pay for this for a FOSS application (which is reasonable).

If it is not unreasonable, I could setup a way for the user to provide their own API key for the Pirate Weather integration so that there is no need for payment. This would require any users of the app that want to use Pirate Weather to sign up for an API key. To help with the added complexity to the user in this scenario, I could also provide some basic instructions and a link to the user somewhere in the app to make this easier for less tech savvy individuals.

I am opening this as a feature request because I want to run this past the maintainers of this repository before proceeding with anything in order to ensure that this is something that would be acceptable. Should this be determined to be acceptable, I will work on this feature myself and raise a pull request when the code is ready.

apederson94 avatar Aug 16 '23 01:08 apederson94

I still haven't decided how to deal with this in general. I will definitely not pay for any services since that would result in a loss for me, but I will eventually run into the same problem for HERE and OpenWeatherMap. Allowing users to provide their own API key would be the easiest solution, and it would also benefit users of the F-Droid builds (which currently come without those weather providers enabled). But it's kinda mid. It turns the launcher from a ready-to-use application to one with a complicated, user-unfriendly setup. Whatever, it is what it is, I guess.

With that preamble out of the way, there is nothing really stopping you from adding other providers that require an API key. So feel free to implement this provider. And when you do, make sure to make your implementation of entering and storing the API key as generic as possible so that it can later be reused for other providers.

To help with the added complexity to the user in this scenario, I could also provide some basic instructions and a link to the user somewhere in the app to make this easier for less tech savvy individuals.

Feel free to add a page to the user guide (in the docs folder).

MM2-0 avatar Aug 21 '23 16:08 MM2-0

But it's kinda mid. It turns the launcher from a ready-to-use application to one with a complicated, user-unfriendly setup. Whatever, it is what it is, I guess.

I agree with this sentiment. It isn't a great solution, but I think it's probably the only one that is available to this project in the long-term anyways. I'll try to throw something together that's more generic of course so that it can be re-used when the time comes that your API keys are being overloaded. If the initial build doesn't live up to the design language, it can always be modified as well. Thanks for the reply/insight into your opinion!

apederson94 avatar Aug 23 '23 00:08 apederson94

Hey I'm slowly working on this as I find time. Do you want this all in one big pull request or do you want me to put everything behind like debug build flags and raise smaller pull requests as they come along?

apederson94 avatar Sep 04 '23 06:09 apederson94

I won't merge anything until it's production ready. But feep free to create a pull request, mark it as a draft, and update it as you are working on this.

MM2-0 avatar Sep 08 '23 12:09 MM2-0

Hey @apederson94, do you still plan to work on this? I have implemented a plugin API so that weather provider can now be implemented as plugins rather than being coded into the main app. It's not finalized yet and I haven't written any docs yet, but here is an example how it would work.

If you're still interested in implementing this, it would be better to implement it as a plugin.

MM2-0 avatar Dec 23 '23 15:12 MM2-0

Hey @MM2-0, sorry it's been quite some time. I think I'll start poking at this again. I think when I left off last it was in a somewhat broken state. I'll check out the plugin stuff to see if I can grok it. I'll write you back here if I can't figure it out or something. Really excited to see there's some sort of structure at least that I can try to figure out now!

I do have an initial question though. How do I go about releasing this change? Is this something that gets bundled into the launcher or is that something that I need to release via F-Droid or the Play Store and then the end user needs to install it similar to how AnySoftKeyboard language packs and themes are released?

apederson94 avatar Oct 12 '24 00:10 apederson94

I do have an initial question though. How do I go about releasing this change? Is this something that gets bundled into the launcher or is that something that I need to release via F-Droid or the Play Store and then the end user needs to install it similar to how AnySoftKeyboard language packs and themes are released?

Plugins are standalone APK files that need to be installed alongside the main app. Currently, I distribute them on my F-Droid repository, but I want to integrate some sort of plugin store into the launcher at some point.

MM2-0 avatar Oct 12 '24 07:10 MM2-0