Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Conversation

steven676
Copy link
Contributor

Fixes a couple of issues with display in the weather plugin.

Copy link
Member

@kpengboy kpengboy left a 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

if unit == 'f':
windunit_text = 'mph'

wind_text = f'{windspeed}{windunit_text}{winddeg_text}'
Copy link
Member

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

Copy link
Contributor Author

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
@steven676 steven676 force-pushed the master branch 2 times, most recently from 937a8f7 to b5317e7 Compare September 22, 2019 22:33
@steven676
Copy link
Contributor Author

Okay, now with the requested changes (plus another style fix to shut the checks up) ...

Copy link
Member

@kpengboy kpengboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@aesthetic aesthetic self-requested a review September 23, 2019 03:11
Copy link
Member

@emmatyping emmatyping left a 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().
@steven676 steven676 merged commit 32be829 into ocf:master Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants