Differentiate current weather icons from weekly prevision
This commit is contained in:
parent
9e15da095b
commit
cac484840e
@ -114,7 +114,7 @@ class WeatherJumboCurrentModule:
|
||||
# current
|
||||
curweather = WeatherAPI().get_currently()
|
||||
|
||||
icon = Image.open("icons/" + WeatherAPI.get_icon(curweather["icon"])).resize((height, height))
|
||||
icon = Image.open("icons/" + WeatherAPI.get_icon(curweather["icon"], current=True)).resize((height, height))
|
||||
image.paste(icon, (int(width*self.middle_align - height), 0), icon)
|
||||
|
||||
draw.text(
|
||||
|
@ -40,21 +40,36 @@ class DarkSkyAPI:
|
||||
return res
|
||||
|
||||
|
||||
def get_icon(icon):
|
||||
def get_icon(icon, current=False):
|
||||
if icon == "clear-day":
|
||||
return "wi-day-sunny.png"
|
||||
elif icon == "clear-night":
|
||||
return "wi-night-clear.png"
|
||||
elif icon == "rain":
|
||||
if not current:
|
||||
return "wi-day-rain.png"
|
||||
else:
|
||||
return "wi-rain.png"
|
||||
elif icon == "snow":
|
||||
if not current:
|
||||
return "wi-day-snow.png"
|
||||
else:
|
||||
return "wi-snow.png"
|
||||
elif icon == "sleet":
|
||||
if not current:
|
||||
return "wi-day-sleet.png"
|
||||
else:
|
||||
return "wi-sleet.png"
|
||||
elif icon == "wind":
|
||||
if not current:
|
||||
return "wi-day-windy.png"
|
||||
else:
|
||||
return "wi-strong-wind.png"
|
||||
elif icon == "fog":
|
||||
if not current:
|
||||
return "wi-day-fog.png"
|
||||
else:
|
||||
return "wi-fog.png"
|
||||
elif icon == "cloudy":
|
||||
return "wi-cloudy.png"
|
||||
elif icon == "partly-cloudy-day":
|
||||
@ -62,8 +77,14 @@ class DarkSkyAPI:
|
||||
elif icon == "partly-cloudy-night":
|
||||
return "wi-night-partly-cloudy.png"
|
||||
elif icon == "hail":
|
||||
if not current:
|
||||
return "wi-day-hail.png"
|
||||
else:
|
||||
return "wi-hail.png"
|
||||
elif icon == "thunderstorm":
|
||||
if not current:
|
||||
return "wi-day-thunderstorm.png"
|
||||
else:
|
||||
return "wi-thunderstorm.png"
|
||||
elif icon == "tornado":
|
||||
return "wi-tornado.png"
|
||||
|
Loading…
Reference in New Issue
Block a user