mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-06 11:33:41 -05:00
Fix a bug in wind (mph vs kph), add option to show Updated
This commit is contained in:
parent
8c321f0dd3
commit
584127536a
@ -272,6 +272,7 @@ class Weather(callbacks.Plugin):
|
|||||||
'astronomy':self.registryValue('astronomy'),
|
'astronomy':self.registryValue('astronomy'),
|
||||||
'pressure':self.registryValue('showPressure'),
|
'pressure':self.registryValue('showPressure'),
|
||||||
'wind':self.registryValue('showWind'),
|
'wind':self.registryValue('showWind'),
|
||||||
|
'updated':self.registryValue('showUpdated'),
|
||||||
'forecast':False,
|
'forecast':False,
|
||||||
'strip':False,
|
'strip':False,
|
||||||
'uv':False,
|
'uv':False,
|
||||||
@ -385,8 +386,8 @@ class Weather(callbacks.Plugin):
|
|||||||
if data['current_observation']['wind_kph'] < 1: # no wind.
|
if data['current_observation']['wind_kph'] < 1: # no wind.
|
||||||
outdata['wind'] = "None"
|
outdata['wind'] = "None"
|
||||||
else:
|
else:
|
||||||
outdata['wind'] = "{0}@{1}kph".format(self._wind(data['current_observation']['wind_degrees']),data['current_observation']['wind_mph'])
|
outdata['wind'] = "{0}@{1}kph".format(self._wind(data['current_observation']['wind_degrees']),data['current_observation']['wind_kph'])
|
||||||
if data['current_observation']['wind_gust_mph'] > 0:
|
if data['current_observation']['wind_gust_kph'] > 0:
|
||||||
outdata['wind'] += " ({0}kph gusts)".format(data['current_observation']['wind_gust_kph'])
|
outdata['wind'] += " ({0}kph gusts)".format(data['current_observation']['wind_gust_kph'])
|
||||||
|
|
||||||
# handle the time. concept/method from WunderWeather plugin.
|
# handle the time. concept/method from WunderWeather plugin.
|
||||||
@ -517,6 +518,8 @@ class Weather(callbacks.Plugin):
|
|||||||
# add in the first forecast item in conditions + updated time.
|
# add in the first forecast item in conditions + updated time.
|
||||||
output += " | {0}: {1} {2}: {3}".format(self._bold(forecastdata[0]['day']),\
|
output += " | {0}: {1} {2}: {3}".format(self._bold(forecastdata[0]['day']),\
|
||||||
forecastdata[0]['text'],self._bold(forecastdata[1]['day']),forecastdata[1]['text'])
|
forecastdata[0]['text'],self._bold(forecastdata[1]['day']),forecastdata[1]['text'])
|
||||||
|
# show Updated?
|
||||||
|
if args['updated']:
|
||||||
output += " | {0} {1}".format(self._bold('Updated:'), outdata['observation'])
|
output += " | {0} {1}".format(self._bold('Updated:'), outdata['observation'])
|
||||||
# output.
|
# output.
|
||||||
if self.registryValue('disableANSI', msg.args[0]):
|
if self.registryValue('disableANSI', msg.args[0]):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user