Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Option to round fractional temperatures to whole numbers #609

Merged

Conversation

mattchesters
Copy link
Contributor

@mattchesters mattchesters commented Dec 22, 2023

This PR adds an additional option to display fractional hourly temperatures into their nearest whole number.

image

Behavior change:

By default, the existing default behavior is observed, where fractional temperatures are rendered if the weather entity is serving fractional temperatures.

When the round_temperatures: true is specified, the number served by weather entity is rounded to the nearest whole number using Math.round().

Tests

Tests have been modified, to include a fractional temperature in mock data.

@mattchesters mattchesters changed the title Feature: Option round fractional temperatures to whole numbers Feature: Option to round fractional temperatures to whole numbers Dec 22, 2023
Copy link
Owner

@decompil3d decompil3d left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Just a small nitpick and a question for you.

src/weather-bar.ts Outdated Show resolved Hide resolved
src/weather-bar.ts Outdated Show resolved Hide resolved
Copy link
Owner

@decompil3d decompil3d left a comment

Choose a reason for hiding this comment

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

Thanks for adjusting. One more small fix and I think we'll be good.

src/weather-bar.ts Outdated Show resolved Hide resolved
Co-authored-by: Jonathan Keslin <[email protected]>
@wsw70
Copy link

wsw70 commented Feb 19, 2024

Would there be a chance to merge this PR? It is an awesome addition.

@decompil3d decompil3d merged commit e60ae14 into decompil3d:main Feb 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants