Display next stop just before an event

This commit is contained in:
nemunaire 2022-08-21 04:03:33 +02:00
commit e380d544d9
3 changed files with 133 additions and 11 deletions

26
main.py
View file

@ -60,20 +60,30 @@ def main():
moon = WeatherMoonPhaseModule().draw_module(config, 65, 65)
image.paste(moon, (0, 113), moon)
# weekly weather
from modules.weather import WeeklyWeatherModule
image.paste(WeeklyWeatherModule().draw_module(config, int(480/1.6), 275), (480-int(480/1.6), 255))
# ical
from modules.ical import IcalModule
ical = IcalModule(config)
cal = ical.draw_module(config, 480-int(480/1.6), 255)
image.paste(cal, (0, 250))
occuped_space = 0
evt_coming = ical.event_coming(config)
if evt_coming:
from modules.ratp import RATPNextStopModule
nstops = RATPNextStopModule().draw_module(config, ["RB/cite+universitaire", "M7/porte+d'italie"], int(480/1.6), 275)
image.paste(nstops, (480-int(480/1.6), 255))
occuped_space = nstops.height
if occuped_space < 250:
# weekly weather
from modules.weather import WeeklyWeatherModule
image.paste(WeeklyWeatherModule().draw_module(config, int(480/1.6), 275), (480-int(480/1.6), 255 + occuped_space))
# 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), 155))
# ical
from modules.ical import IcalModule
cal = IcalModule(config).draw_module(config, 480-int(480/1.6), 255)
image.paste(cal, (0, 250))
# Toolbar
from modules.weather import WeatherToolbarModule
image.paste(WeatherToolbarModule().draw_module(config, 480, 50), (0, 530))