Skip to content

Commit

Permalink
Add description why we use integer for temperature, humidity and wind…
Browse files Browse the repository at this point in the history
… speed
  • Loading branch information
708yamaguchi authored and knorth55 committed Jan 14, 2021
1 parent 29848ae commit 5501bb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jsk_fetch_robot/jsk_fetch_startup/scripts/time_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 5501bb4

Please sign in to comment.