add wind indication

This commit is contained in:
Tyjak 2014-06-19 21:32:30 +02:00
parent 3aa33932a5
commit 80110775f5

View File

@ -10,6 +10,7 @@ class Weather(IntervalModule):
Available formatters: Available formatters:
* {current_temp} * {current_temp}
* {current_wind}
* {humidity} * {humidity}
Requires pywapi from PyPI. Requires pywapi from PyPI.
@ -44,9 +45,11 @@ class Weather(IntervalModule):
conditions = result["current_conditions"] conditions = result["current_conditions"]
temperature = conditions["temperature"] temperature = conditions["temperature"]
humidity = conditions["humidity"] humidity = conditions["humidity"]
wind = conditions["wind"]
units = result["units"] units = result["units"]
color = None color = None
current_temp = "{t}°{d} ".format(t=temperature, d=units["temperature"]) current_temp = "{t}°{d}".format(t=temperature, d=units["temperature"])
current_wind = "{t} {s}{d}".format(t=wind["text"], s=wind["speed"], d=units["speed"])
if self.colorize: if self.colorize:
icon, color = self.color_icons.get(conditions["text"], icon, color = self.color_icons.get(conditions["text"],
@ -57,6 +60,6 @@ class Weather(IntervalModule):
color = color color = color
self.output = { self.output = {
"full_text": self.format.format(current_temp=current_temp, humidity=humidity), "full_text": self.format.format(current_temp=current_temp, current_wind=current_wind, humidity=humidity),
"color": color "color": color
} }