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

[HU] conversation issue for detailed_weather when wind gust speed is not available #2826

Closed
ahhoj opened this issue Jan 4, 2025 · 3 comments · Fixed by #2871
Closed

[HU] conversation issue for detailed_weather when wind gust speed is not available #2826

ahhoj opened this issue Jan 4, 2025 · 3 comments · Fixed by #2871
Assignees
Labels

Comments

@ahhoj
Copy link

ahhoj commented Jan 4, 2025

https://github.com/home-assistant/intents/blob/main/responses/hu/HassGetWeather.yaml

There are multiple conversation to float like this: https://github.com/home-assistant/intents/blob/main/responses/hu/HassGetWeather.yaml#L178

And the next line tries to check if there were actual data. But the problem is, if the original data source never existed, this conversation will fail, and cannot continue. For exmaple, with openweathermap provider for my location, the wind gust speed data is not available, but generally handling this case for other parts of the code should be updated. One possible solution should be to add a default None value here, like:
{% set wind_gust_speed = state.attributes.get('wind_gust_speed') | float(None) %}

At least I guess this should do the trick, but didn't try.

@v1k70rk4 v1k70rk4 self-assigned this Jan 9, 2025
@v1k70rk4
Copy link
Member

v1k70rk4 commented Jan 9, 2025

Hi,

I'm back from vacation, and I'll take a look at the issue. Interestingly, when I tested it, there were no errors :( It's possible something has changed.

But the code is getting so complicated that I might just revert it to its original state.

@ahhoj
Copy link
Author

ahhoj commented Jan 10, 2025

if all the data exist, then no problem will occur :)
I don't think any revert is needed, this looks kind of small fix, I just don't have a development setup for this. But as far as I can tell, a default None value for the float conversions should be enough

v1k70rk4 added a commit to v1k70rk4/intents that referenced this issue Jan 14, 2025
@v1k70rk4 v1k70rk4 linked a pull request Jan 14, 2025 that will close this issue
v1k70rk4 added a commit that referenced this issue Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@v1k70rk4
Copy link
Member

Thank you for the solution suggestion ;) I tested it, and it works beautifully. It will be included in version 2025.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants