changed formatting for new weather api
This commit is contained in:
@@ -4470,14 +4470,14 @@ class StockTicker():
|
|||||||
weekday = weekdays[datetime.today().weekday()]
|
weekday = weekdays[datetime.today().weekday()]
|
||||||
date_img = self.textImage((month + ' ' + date + ',' + weekday).upper(), small_font)
|
date_img = self.textImage((month + ' ' + date + ',' + weekday).upper(), small_font)
|
||||||
rain_img = Image.open(weather_dir + '/rain-chance.png')
|
rain_img = Image.open(weather_dir + '/rain-chance.png')
|
||||||
rtext_img = self.textImage(str(int(current_weather['rain_chance']*100)) + '%', small_font)
|
rtext_img = self.textImage(str(current_weather['rain_chance']) + '%', small_font)
|
||||||
cloud_img = Image.open(weather_dir + '/clouds.png')
|
cloud_img = Image.open(weather_dir + '/clouds.png')
|
||||||
ctext_img = self.textImage(str(current_weather['clouds']) + '%', small_font)
|
ctext_img = self.textImage(str(current_weather['clouds']) + '%', small_font)
|
||||||
wind_img = Image.open(weather_dir + '/wind.png')
|
wind_img = Image.open(weather_dir + '/wind.png')
|
||||||
w_speed = current_weather['wind_speed']*3.6
|
w_speed = current_weather['wind_speed']
|
||||||
w_unit = 'K/H'
|
w_unit = 'K/H'
|
||||||
if all_settings["wind_speed"] == "miles/hour":
|
if all_settings["wind_speed"] == "miles/hour":
|
||||||
w_speed = current_weather['wind_speed']*2.236936
|
w_speed = current_weather['wind_speed']/1.609
|
||||||
w_unit = 'M/H'
|
w_unit = 'M/H'
|
||||||
wtext_img = self.textImage("{0:.0f}".format(w_speed) + w_unit, small_font)
|
wtext_img = self.textImage("{0:.0f}".format(w_speed) + w_unit, small_font)
|
||||||
wdir_img = self.textImage(self.degreesToCompass(current_weather['wind_direction']).upper(), small_font)
|
wdir_img = self.textImage(self.degreesToCompass(current_weather['wind_direction']).upper(), small_font)
|
||||||
@@ -4906,7 +4906,7 @@ class StockTicker():
|
|||||||
|
|
||||||
if daily_weathers['current_weather']:
|
if daily_weathers['current_weather']:
|
||||||
rain_img = Image.open(weather_dir + '/rain-chance.png')
|
rain_img = Image.open(weather_dir + '/rain-chance.png')
|
||||||
rtext_img = self.textImage(str(int(daily_weather[0]['rain_chance']*100)) + '%', small_font)
|
rtext_img = self.textImage(str(daily_weather[0]['rain_chance']) + '%', small_font)
|
||||||
hum_img = Image.open(weather_dir + '/humidity.png')
|
hum_img = Image.open(weather_dir + '/humidity.png')
|
||||||
htext_img = self.textImage(str(daily_weather[0]['humidity']) + '%', small_font)
|
htext_img = self.textImage(str(daily_weather[0]['humidity']) + '%', small_font)
|
||||||
wind_img = Image.open(weather_dir + '/wind.png')
|
wind_img = Image.open(weather_dir + '/wind.png')
|
||||||
@@ -4917,10 +4917,10 @@ class StockTicker():
|
|||||||
ctext_img = self.textImage(str(daily_weather[0]['clouds']) + '%', small_font)
|
ctext_img = self.textImage(str(daily_weather[0]['clouds']) + '%', small_font)
|
||||||
wind_img = Image.open(weather_dir + '/wind.png')
|
wind_img = Image.open(weather_dir + '/wind.png')
|
||||||
|
|
||||||
w_speed = daily_weather[0]['wind_speed']*3.6
|
w_speed = daily_weather[0]['wind_speed']
|
||||||
w_unit = 'K/H'
|
w_unit = 'K/H'
|
||||||
if daily_weathers['wind_speed'] == "miles/hour":
|
if daily_weathers['wind_speed'] == "miles/hour":
|
||||||
w_speed = daily_weather[0]['wind_speed']*2.236936
|
w_speed = daily_weather[0]['wind_speed']/1.609
|
||||||
w_unit = 'M/H'
|
w_unit = 'M/H'
|
||||||
|
|
||||||
wtext_img = self.textImage("{0:.0f}".format(w_speed) + w_unit, small_font)
|
wtext_img = self.textImage("{0:.0f}".format(w_speed) + w_unit, small_font)
|
||||||
|
|||||||
Reference in New Issue
Block a user