weather: Should resolve #23
This commit is contained in:
parent
e788d83255
commit
cef22ea7bb
@ -1,5 +1,7 @@
|
|||||||
from i3pystatus import IntervalModule
|
from i3pystatus import IntervalModule
|
||||||
import pywapi
|
import pywapi
|
||||||
|
from i3pystatus.core.util import internet, require
|
||||||
|
|
||||||
|
|
||||||
class Weather(IntervalModule):
|
class Weather(IntervalModule):
|
||||||
|
|
||||||
@ -25,6 +27,7 @@ class Weather(IntervalModule):
|
|||||||
units = "C"
|
units = "C"
|
||||||
format = "{current_temp}"
|
format = "{current_temp}"
|
||||||
|
|
||||||
|
@require(internet)
|
||||||
def run(self):
|
def run(self):
|
||||||
result = pywapi.get_weather_from_weather_com(self.location_code, self.units)
|
result = pywapi.get_weather_from_weather_com(self.location_code, self.units)
|
||||||
conditions = result['current_conditions']
|
conditions = result['current_conditions']
|
||||||
|
Loading…
Reference in New Issue
Block a user