Split MoonPhaseModule and SunModule

This commit is contained in:
nemunaire 2022-08-14 13:32:52 +02:00
commit e7a1eac8d7
2 changed files with 33 additions and 20 deletions

19
main.py
View file

@ -53,15 +53,16 @@ def main():
image.paste(WeatherJumboCurrentModule().draw_module(config, 480, 150), (0, 50))
# rule
image.paste(modules.RuleModule().draw_module(config, 480, 1), (0, 192))
image.paste(modules.RuleModule().draw_module(config, 450, 1), (30, 192))
# pluie
from modules.weather import WeatherRainModule
image.paste(WeatherRainModule().draw_module(config, 480/2, 100), (0, 205))
image.paste(WeatherRainModule().draw_module(config, 480-int(480/1.6), 94), (0, 205))
# sunrise/moonrise
from modules.weather import WeatherSunMoonModule
image.paste(WeatherSunMoonModule().draw_module(config, int(480/2), 100), (int(480/2), 205))
# moon phase
from modules.weather import WeatherMoonPhaseModule
moon = WeatherMoonPhaseModule().draw_module(config, 65, 65)
image.paste(moon, (0, 163), moon)
# weekly weather
from modules.weather import WeeklyWeatherModule
@ -76,11 +77,15 @@ def main():
from modules.weather import WeatherTemperatureModule
image.paste(WeatherTemperatureModule().draw_module(config, 480, 200), (0, 580))
# sunrise/set
from modules.weather import WeatherSunModule
image.paste(WeatherSunModule().draw_module(config, int(480/2), 20, start_align=5), (0, 780))
fnt = ImageFont.truetype(config.fnt_R_path, 11)
draw.text(
(5, 798),
(475, 798),
"Dernière génération le " + datetime.now().strftime("%c"),
fill="black", anchor="lb", font=fnt
fill="black", anchor="rb", font=fnt
)
try: