weather: Add others gauge type when no sun and no rain
This commit is contained in:
parent
d3331efc4b
commit
268f6350d5
@ -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()))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user