From 452a6097e3dd1549b49b332b95ec27d26e9533af Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 18 May 2024 18:54:58 +0200 Subject: [PATCH] weather: Improve next hour --- modules/weather.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/weather.py b/modules/weather.py index 7bbdeef..e4e0905 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -147,8 +147,10 @@ class WeatherJumboCurrentModule: dayweather = list(itertools.islice(WeatherAPI().get_hourly(), 2)) - if dayweather[0]["weather"][0]["description"] != dayweather[1]["weather"][0]["description"]: - display_longtext(draw, (width*self.middle_align, height/1.28), dayweather[1]["weather"][0]["description"] + " la prochaine heure.\n" + thisdayweather["summary"] + ".", fill="black", anchor="lm", font=fnt_Rig, maxwidth=(1-self.middle_align)*width) + if dayweather[0]["weather"][0]["description"] != curweather["weather"][0]["description"]: + description = dayweather[0]["weather"][0]["description"] + description = description[0].upper() + description[1:] + display_longtext(draw, (width*self.middle_align, height/1.28), description + " la prochaine heure.\n" + thisdayweather["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), thisdayweather["summary"] + ".", fill="black", anchor="lm", font=fnt_Rig, maxwidth=(1-self.middle_align)*width)