From 26aa7f66139efb1658c8651ee780be77aaacb91b Mon Sep 17 00:00:00 2001 From: Naoya Yamaguchi <708yamaguchi@gmail.com> Date: Wed, 13 Jan 2021 17:38:25 +0900 Subject: [PATCH] Add description why we use integer for temperature, humidity and wind speed --- jsk_fetch_robot/jsk_fetch_startup/scripts/time_signal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsk_fetch_robot/jsk_fetch_startup/scripts/time_signal.py b/jsk_fetch_robot/jsk_fetch_startup/scripts/time_signal.py index 75454186550..ca5781dc444 100755 --- a/jsk_fetch_robot/jsk_fetch_startup/scripts/time_signal.py +++ b/jsk_fetch_robot/jsk_fetch_startup/scripts/time_signal.py @@ -108,6 +108,8 @@ def _get_weather_forecast(self, lang='en'): url = 'http://api.openweathermap.org/data/2.5/weather?q=tokyo&lang={}&units=metric&appid={}'.format(lang, self.appid) # NOQA resp = json.loads(urllib2.urlopen(url).read()) weather = resp['weather'][0]['description'] + # aques_talk replaces decimal point to "。" (e.g. 7.8度 -> 7。8ど) + # So we use integer for temperature, humidity and wind speed. temp = int(resp['main']['temp']) humidity = int(resp['main']['humidity']) wind_speed = int(resp['wind']['speed'])