-
Notifications
You must be signed in to change notification settings - Fork 24
Weather plugin fixes #154
Weather plugin fixes #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming you've tested this
ircbot/plugin/weather.py
Outdated
if unit == 'f': | ||
windunit_text = 'mph' | ||
|
||
wind_text = f'{windspeed}{windunit_text}{winddeg_text}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: would put space between number and unit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following the original behavior here -- we can certainly have a space, though.
According to the API documentation [1]: * With imperial units selected, wind speed is returned in mph, not m/s; * Humidity is returned as a percentage, not a dimensionless value. Change the output to reflect this. [1] https://openweathermap.org/current
937a8f7
to
b5317e7
Compare
Okay, now with the requested changes (plus another style fix to shut the checks up) ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you this looks great!
…ding At the moment, due to the use of int() to round down the various temperature bounds in icon() and color(), the temperature boundaries between colors and icons depend on choice of unit. That leads to fun like this: <sluo> create: weather <create> Berkeley: 74.57°F ☀ clear sky; wind: 6.93m/s 320° (NW); humidity: 49; UV index: 6.26 <sluo> create: weather -c <create> Berkeley: 23.65°C ☢ clear sky; wind: 3.1m/s 320° (NW); humidity: 49; UV index: 6.26 Don't round temperatures to avoid this issue; while we're at it, convert the current temperature instead of the bounds, to avoid doing a bunch of conversions every time we call color().
Fixes a couple of issues with display in the weather plugin.