current weather prof fix and tiny icons

This commit is contained in:
Justin 2022-06-12 18:40:22 +08:00 committed by GitHub
parent c58c3dbaf9
commit d7aec8caa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2055,9 +2055,13 @@ class StockTicker():
main = current_weather['main_weather'] main = current_weather['main_weather']
if main == 'Clouds': if main == 'Clouds':
main = current_weather['description'] main = current_weather['description']
if main == 'Rain':
main = current_weather['description']
weather_ids = {'Clear': '01', 'few clouds': '02', 'scattered clouds': '03', 'broken clouds':'04', 'overcast clouds':'04', 'Drizzle':'09', weather_ids = {'Clear': '01', 'few clouds': '02', 'scattered clouds': '03', 'broken clouds':'04', 'overcast clouds':'04', 'Drizzle':'09',
'Rain':'10', 'Thunderstorm':'11', 'Snow':'13', 'Mist': '50', 'Smoke': '50', 'Haze': '50', 'Dust': '50', 'Fog': '50', 'Rain':'10', 'Thunderstorm':'11', 'Snow':'13', 'Mist': '50', 'Smoke': '50', 'Haze': '50', 'Dust': '50', 'Fog': '50',
'Sand': '50', 'Ash': '50', 'Squall': '50', 'Tornado': '50'} 'Sand': '50', 'Ash': '50', 'Squall': '50', 'Tornado': '50', 'light rain': '10', 'moderate rain': '10', 'heavy intensity rain': '10',
'very heavy rain': '10', 'extreme rain': '10', 'freezing rain': '13', 'light intensity shower rain': '09', 'shower rain': '09',
'heavy intensity shower rain': '09', 'ragged shower rain': '09'}
weather_dir = './logos/weather_icons' weather_dir = './logos/weather_icons'
@ -2074,9 +2078,9 @@ class StockTicker():
x_offset += date_img.size[0] + 2 x_offset += date_img.size[0] + 2
weather_img = Image.open(weather_dir + '/weather_type_icons/' + weather_ids[main] + '.png') weather_img = Image.open(weather_dir + '/small_icons/' + weather_ids[main] + '.png')
w, h = weather_img.size w, h = weather_img.size
weather_img = weather_img.resize((int(w/2), int(h/2))) #weather_img = weather_img.resize((int(w/2), int(h/2)))
main = current_weather['main_weather'] main = current_weather['main_weather']
main_img = self.textImage(main.upper(), font) main_img = self.textImage(main.upper(), font)