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

wind_bearing does not handle direction as string e.g. NNW #303

Closed
biffel opened this issue Jan 23, 2023 · 3 comments · Fixed by #312
Closed

wind_bearing does not handle direction as string e.g. NNW #303

biffel opened this issue Jan 23, 2023 · 3 comments · Fixed by #312
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@biffel
Copy link

biffel commented Jan 23, 2023

It appears that the current code expects the attribute wind_bearing in the forecast to be a numeric bearing in degrees.

The Home Assistant documentation offers two alternatives to weather forecast integrations - either numeric degrees or a string 1-3 chars representing direction (e.g. NNW).

Name Type Description
wind_bearing float or string The current wind bearing in azimuth angle (degrees) or 1-3 letter cardinal direction.

This second format does not appear to be supported. Can it be?

One example that outputs strings is the Australian 'Bureau of Meteorology' custom integration available through HACS, which puts uppercase directions in wind_bearing (e.g. SSE, W, NE etc).

@decompil3d
Copy link
Owner

Excellent bug report! Thank you so much for these details. I'll look at this when I have time -- probably later this week. Contributions welcome if someone else gets to it first.

@decompil3d decompil3d added bug Something isn't working good first issue Good for newcomers labels Jan 23, 2023
@decompil3d decompil3d self-assigned this Jan 24, 2023
@biffel
Copy link
Author

biffel commented Jan 29, 2023

Thanks! Working for me. Shame the wind barb display option isn't available in this circumstance but great to have the directions displayed as text now.

@decompil3d
Copy link
Owner

Thanks for confirming that the fix works. Ya, the wind barb wouldn't be accurate anyway cause the cardinal directions are so imprecise. I figured it was better to block that combination rather than showing misleading info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants