-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
feat: migrate weather.lua to use WeatherAPI #448
Conversation
When I looked into OpenWeatherMap 3.0 API they demanded credit card information even for their free tier. Therefore I decided to move to another provider with a generous tier. In a first step I rewrote the current weather report (i.e. no forecast) to use it. I haven't received any commentary on streetturtle#442 so I don't know where your mind was going. If OpenWeatherMap phases out its 2.5 API and nobody else intends to use their 3.0 one, I offer to take this implementation instead. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
Really appreciated that you're doing this. :) An error I noticed with the original implementation: If the API call did not return any JSON nor an error code (it could sometimes get html instead), the widget did not know how to handle it, and would fail to update properly. I don't remember quite how it failed, since I edited mine to handle that (just a |
It appears that OpenWeatherMap sometimes sent out bad JSON. Learn from the lesson and do better in this PR. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
Let's make Luacheck happy! Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
@AlbeyAmakiir Thank you. I've added a safeguard similar to the stderr case. @streetturtle The Luacheck fails over an unused variable in the APT widget. Shall I address it in this PR? |
That would be amazing! Thanks! |
I'll test it today/tomorrow and will let you know. Thank you for your work! |
Luacheck fails over this unused code. Streetturtle gave me green light to remove it as part of this PR. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This was done to allow for choice. In the first step I copied over the existing code into a new folder and accompanied it with icons and locales. There is no indicator of night in the JSON responses, which made me delete the respective icons. I copied and updated the README to fit the current implementation. I will need to add screenshots before I can ask for another round of review. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This is going to be marked as deprecated by streetturtle going forward. As of today, I am still able to successfully call the v2.5 API. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
Unlike weather widget I only have the current weather in place here. I'm okay with the default font so I have not created another screenshot. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
@streetturtle I feel this is ready for another round of review |
I much appreciate you taking the time to do this. WeatherAPI looks pretty nice! Looking at the I may dig into this myself, but any thoughts you might have would be very appreciated! |
Thank you. Day/Night icons will be part of #455 |
When I looked into OpenWeatherMap 3.0 API they demanded credit card information even for their free tier. Therefore I decided to move to another provider with a generous tier.
In a first step I rewrote the current weather report (i.e. no forecast) to use it.
I haven't received any commentary on #442 so I don't know where your mind was going. If OpenWeatherMap phases out its 2.5 API and nobody else intends to use their 3.0 one, I offer to take this implementation instead.