From 44aa1bc564c9f52341c47cf29fef33b968dc627d Mon Sep 17 00:00:00 2001 From: Pavle Portic Date: Sun, 26 Feb 2017 14:17:26 +0100 Subject: [PATCH] [modules/weather] Add API key parameter documentation and round temperature to int --- bumblebee/modules/weather.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/weather.py b/bumblebee/modules/weather.py index d145e5f..fbe2c7c 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -10,6 +10,7 @@ Parameters: * weather.interval: Interval (in minutes) for updating weather information * weather.location: Set location (ISO 3166 country code), defaults to 'auto' for getting location from http://ipinfo.io * weather.unit: metric (default), kelvin, imperial + * weather.apikey: API key from http://api.openweathermap.org """ import bumblebee.input @@ -58,7 +59,7 @@ class Module(bumblebee.engine.Module): else: weather_url = "{url}&q={city}".format(url=weather_url, city=self._location) weather = json.loads(requests.get(weather_url).text) - self._temperature = weather['main']['temp'] + self._temperature = int(weather['main']['temp']) self._timer += 1 return