Refactor alerts

This commit is contained in:
nemunaire 2022-08-14 15:32:52 +02:00
parent 084dce621c
commit 606895f63b
3 changed files with 111 additions and 87 deletions

15
main.py
View file

@ -68,16 +68,21 @@ def main():
from modules.weather import WeeklyWeatherModule
image.paste(WeeklyWeatherModule().draw_module(config, int(480/1.6), 275), (480-int(480/1.6), 305))
# alerts
from modules.weather import WeatherAlertsModule
mod = WeatherAlertsModule().draw_module(config, 480, 200)
image.paste(mod, (0, 580-mod.height-5), mod)
# RATP weather
from modules.ratp import RATPWeatherModule
ratp = RATPWeatherModule().draw_module(config, int(480/1.6), 94)
image.paste(ratp, (480-int(480/1.6), 205))
# alerts
alerts = []
from modules.weather import WeatherAlerts
alerts += WeatherAlerts().gen_alerts()
from modules import AlertsModule
mod = AlertsModule(alerts).draw_module(config, 480, 200)
image.paste(mod, (0, 580-mod.height-5), mod)
# températures
from modules.weather import WeatherTemperatureModule
image.paste(WeatherTemperatureModule().draw_module(config, 480, 200), (0, 580))