From 80110775f5d6fedbb38a9111f9d1deae0bbd6037 Mon Sep 17 00:00:00 2001 From: Tyjak Date: Thu, 19 Jun 2014 21:32:30 +0200 Subject: [PATCH] add wind indication --- i3pystatus/weather.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/i3pystatus/weather.py b/i3pystatus/weather.py index c62f472..7e0e637 100644 --- a/i3pystatus/weather.py +++ b/i3pystatus/weather.py @@ -10,6 +10,7 @@ class Weather(IntervalModule): Available formatters: * {current_temp} + * {current_wind} * {humidity} Requires pywapi from PyPI. @@ -44,9 +45,11 @@ class Weather(IntervalModule): conditions = result["current_conditions"] temperature = conditions["temperature"] humidity = conditions["humidity"] + wind = conditions["wind"] units = result["units"] 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: icon, color = self.color_icons.get(conditions["text"], @@ -57,6 +60,6 @@ class Weather(IntervalModule): color = color 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 }