This repository was archived by the owner on Oct 2, 2024. It is now read-only.
Weather plugin fixes#154
Merged
Merged
Conversation
kpengboy
approved these changes
Sep 22, 2019
Member
kpengboy
left a comment
There was a problem hiding this comment.
LGTM assuming you've tested this
| if unit == 'f': | ||
| windunit_text = 'mph' | ||
|
|
||
| wind_text = f'{windspeed}{windunit_text}{winddeg_text}' |
Member
There was a problem hiding this comment.
Nit: would put space between number and unit
Contributor
Author
There was a problem hiding this comment.
I was following the original behavior here -- we can certainly have a space, though.
kpengboy
suggested changes
Sep 22, 2019
aesthetic
reviewed
Sep 22, 2019
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
Contributor
Author
|
Okay, now with the requested changes (plus another style fix to shut the checks up) ... |
emmatyping
approved these changes
Sep 23, 2019
Member
emmatyping
left a comment
There was a problem hiding this comment.
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().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a couple of issues with display in the weather plugin.