diff --git a/modules/weather.py b/modules/weather.py index d8f380b..71ecc4d 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -174,12 +174,21 @@ class WeatherRainModule: if thisdayweather["precipProbability"] == 0 and thisdayweather["uvIndex"] > 4: gauge.add('Index UV', [{'value': thisdayweather["uvIndex"] * 10}]) icon_path = "wi-hot.png" - else: + elif thisdayweather["precipProbability"] > 0: gauge.add('Pluie', [{'value': thisdayweather["precipProbability"] * 100 + 1}]) - if thisdayweather["precipProbability"] > 0: - icon_path = "wi-umbrella.png" - else: - icon_path = "wi-na.png" + icon_path = "wi-umbrella.png" + elif thisdayweather["windSpeed"] > 50: + gauge.add('Vent', [{'value': thisdayweather["windSpeed"], 'color': '#999'}]) + icon_path = "wi-strong-wind.png" + elif thisdayweather["visibility"] < 10: + gauge.add('Visibilité', [{'value': thisdayweather["visibility"] * 10, 'color': '#999'}]) + icon_path = "wi-fog.png" + elif thisdayweather["cloudCover"] > 0.4: + gauge.add('Couverture nuageuse', [{'value': thisdayweather["cloudCover"] * 100, 'color': '#999'}]) + icon_path = "wi-cloudy.png" + else: + gauge.add('Pluie', [{'value': thisdayweather["precipProbability"] * 100}]) + icon_path = "wi-na.png" image = Image.open(io.BytesIO(gauge.render_to_png()))