If next hour weather is different from now, display it

This commit is contained in:
nemunaire 2022-08-14 13:33:07 +02:00
parent e7a1eac8d7
commit b19f7a7f36
1 changed files with 4 additions and 1 deletions

View File

@ -139,7 +139,10 @@ class WeatherJumboCurrentModule:
dayweather = WeatherAPI().get_hourly()
display_longtext(draw, (width*self.middle_align, height/1.28), dayweather["summary"], fill="black", anchor="lm", font=fnt_Rig, maxwidth=(1-self.middle_align)*width)
if dayweather["data"][0]["summary"] != dayweather["data"][1]["summary"]:
display_longtext(draw, (width*self.middle_align, height/1.28), dayweather["data"][1]["summary"] + " la prochaine heure.\n" + dayweather["summary"], fill="black", anchor="lm", font=fnt_Rig, maxwidth=(1-self.middle_align)*width)
else:
display_longtext(draw, (width*self.middle_align, height/1.28), dayweather["summary"], fill="black", anchor="lm", font=fnt_Rig, maxwidth=(1-self.middle_align)*width)
return image