#6914 (Add a plugin for weather forecasts)
by Luc Saffre · in Developers · assigned to Luc Saffre
Summary
In Lino Patrols we want to have a basic weather prediction per day in the Patrols planner.
This plugin would use python-weather.
Children
Comments
- 3 months ago by Luc Saffre in reply to Luc Saffre about #6914 (Add a plugin for weather forecasts) : And it doesn't need a threading.Timer because it checks for every request whether last update is older than X seconds.
- 3 months ago by Luc Saffre in reply to Luc Saffre about #6914 (Add a plugin for weather forecasts) (1 reply) : I started experimenting with another approach: pickle the Forecast object into a file and have every Site instance load from this file.
- 3 months ago by Luc Saffre about #6914 (Add a plugin for weather forecasts) (1 reply) : My first implementation had a drawback that every instance of the Site (one for each Python process) was doing at least one request to the weather API.
- 3 months ago by Luc Saffre about #6914 (Add a plugin for weather forecasts) : The python-weather module uses a few enum classes. These are similar to choicelists. And Django has a class models.TextChoices, which seems also to have been written before enums existed in Python. Ha! I was blind: we probably don't need to store this weather information into the database.
- 3 months, 1 week ago by Luc Saffre about #6914 (Add a plugin for weather forecasts) : The patrols planner now shows weather information of style "⛅️, 14..17°, SW 24 km/h". todo: write demo fixtures.
- 3 months, 1 week ago by Luc Saffre about #6914 (Add a plugin for weather forecasts) : I'm discovering the python-weather API. The different kinds of forecasts.
- 3 months, 1 week ago by Luc Saffre about #6914 (Add a plugin for weather forecasts) : The weather API is async. Since it runs as a linod.BackgroundTask, we should probably convert Runnable.run_task to async.
- 3 months, 2 weeks ago by Luc Saffre about #6914 (Add a plugin for weather forecasts) : Created new Ticket #6914 (Add a plugin for weather prediction).