feat: add support for wind barbs when wind_bearing is a string #785
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.
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.
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!