-
Notifications
You must be signed in to change notification settings - Fork 48
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
Implementing alternative weather API (VisualCrossing.com) #265
Conversation
@SamR1 aside from tests (are there existing tests for weather functionality? I don't see them, if so), this should be ready for review. It implements VisualCrossing as a new weather data source, and makes some small tweaks to how the weather is displayed when using Imperial units. It looks as follows: I'm unclear why the sun is displaying as blue... The icon I uploaded has it as yellow. EDIT: I see the inversion is happening because of the |
Hi Thanks for the PR. Just for information, I haven't yet reviewed the alternative weather service providers (sorry, I don't have a lot of free time at the moment to work on FitTrackee). |
👍 I went ahead with VisualCrossing.com due to limitations I felt would cause issues with the other providers mentioned in that issue. Namely, Openmeteo's history API is delayed 5-7 days, so is not useful in real-time, and meteostat has a relatively low free tier of 500 calls/month. VisualCrossing seemed like it checked all the boxes, so to speak. I implemented it with a new environment variable WEATHER_API=visualcrossing # or darksky, meteostat, openmeteo, etc.
WEATHER_API_KEY=123456abcdef |
Hi, So far, I haven't found the perfect replacement for DarkSky. I worked on a base for multiple APIs support to keep DarkSky in addition to VisualCrossing and in case other APIs are supported in the future: 64d770a...alternate_weather_api If it's OK for you, I will push the changes on this PR. Edit:
|
Thanks for pushing this through! I just got around to updating after a while, and it appears to be working well for me. Different but related question... do you know if there's a simple-ish way to reprocess old workouts to add weather info? I see it's stored with each workout in the DB as a JSON in the |
Hi, Unfortunately it's not possible to reprocess workouts for now (maybe in the version with workout processing rewrite). |
Gotcha, I see that in To get around this I wrote a little script that uses the FT API to get workouts and their GPX files, then uses the FT code to call the weather API, then finally directly updates the That's available here in case that helps anyone. It makes use of/requires the |
As described in #51, DarkSky's API will be retired in a few months and isn't open for new signups, meaning new users of FitTrackee cannot get weather data.
After analyzing a few options, I've chosen to implement VisualCrossing.com's timeline API.
Tasks: