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 13, 2021
1 parent 049edec commit c93f0af
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 c93f0af

Please sign in to comment.