From 4fb1f7f08fd1e45734ee3b11579405d3243327e5 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 3 May 2023 12:34:10 +0200 Subject: [PATCH 1/2] Fix Ical module when dealing with UTC event --- modules/ical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ical.py b/modules/ical.py index a2020d0..89fae3f 100644 --- a/modules/ical.py +++ b/modules/ical.py @@ -367,7 +367,7 @@ class IcalModule: ) elif "end" in evt and not isinstance(evt["end"], datetime): pass - elif "end" in evt and (("new_start" in evt and now > evt["new_start"]) or ("new_start" not in evt and now > evt["start"])): + elif "end" in evt and (("new_start" in evt and now > evt["new_start"].astimezone(pytz.timezone('Europe/Paris'))) or ("new_start" not in evt and now > evt["start"].astimezone(pytz.timezone('Europe/Paris')))): align += display_longtext(draw, (2 + fnt_R.getsize(evt["start"].astimezone(pytz.timezone('Europe/Paris')).strftime("%H:%M "))[0], align+line_height*0.6), "Fin à " + (evt["new_end"] if "new_end" in evt else evt["end"]).astimezone(pytz.timezone('Europe/Paris')).strftime("%H:%M"), From 960c1592cd63e9c96da7ab7f5a24c394f4b77d58 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 3 May 2023 12:34:29 +0200 Subject: [PATCH 2/2] Fix weather module when no air_quality available --- modules/weather.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/weather.py b/modules/weather.py index 3297115..18bcb26 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -224,12 +224,15 @@ class WeatherRainModule: elif thisdayweather["avgvis_km"] < 10: gauge.add('Visibilité', [{'value': thisdayweather["avgvis_km"] * 10, 'color': '#999'}]) icon_path = "wi-fog.png" - else: + elif "air_quality" in thisdayweather: gauge.add("Qualité de l'air", [{'value': thisdayweather["air_quality"]["gb-defra-index"] * 10}]) if thisdayweather["air_quality"]["gb-defra-index"] >= 5: icon_path = "wi-smog.png" else: icon_path = "wi-smoke.png" + else: + gauge.add('Vent', [{'value': thisdayweather["maxwind_kph"], 'color': '#999'}]) + icon_path = "wi-wind-beaufort-1.png" image = Image.open(io.BytesIO(gauge.render_to_png()))