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

feat: add support for wind barbs when wind_bearing is a string #785

Merged
merged 5 commits into from
Jan 13, 2025

Conversation

bitnimble
Copy link
Contributor

@bitnimble bitnimble commented Jan 13, 2025

This PR adds support for wind barbs when the "wind_bearing" attribute is a cardinal direction string. This is something that I've wanted in my personal HA, no idea if others desire it - I've made the change locally and thought it would be good to contribute it back upstream.

image

It simply maps cardinal directions to approximate bearing angles (multiples of 22.5deg) - if wind_bearing is not a valid direction, e.g. "n" or "ssw" etc, it falls back to showing nothing.

I've updated tests + removed the obsolete error string as well. Changes are split up per-commit.

re reformatting - it's based on your prettierrc, I have format on save enabled in my IDE so unfortunately it happened before I realised!

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.

Thank you for this contribution! Very much appreciated. And no worries about the formatting - clearly, I should turn on Format on Save in my IDE too 😅

@decompil3d decompil3d merged commit ecd7de9 into decompil3d:main Jan 13, 2025
5 checks passed
@bitnimble
Copy link
Contributor Author

Haha, bear in mind I've only formatted the files I touched so best to do a sweeping format commit at some point first 😄

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.

2 participants