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

Fix compatibility with HA 2024.4 #479

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

skrashevich
Copy link
Contributor

… data

This commit updates the `listener` function within the Yandex Station integration to support a change introduced in version 2024.4.0, where event data can be passed directly as a `Mapping[str, Any]` instead of an `Event` object. The update involves checking the type of the `event_data` parameter and extracting the data from it if it's an instance of `Event`. This change ensures compatibility with Home Assistant's evolving event model while maintaining performance by using a direct type check rather than `isinstance`, which is slower.

The adjustment is critical for ensuring that the Yandex Station integration continues to function correctly without breaking due to the structural changes in how events are passed to listeners in Home Assistant versions 2024.4.0 and onwards.
@AlexxIT AlexxIT merged commit a6f8695 into AlexxIT:master Apr 5, 2024
2 checks passed
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 5, 2024

Thanks!

AlexxIT added a commit that referenced this pull request Apr 5, 2024
@skrashevich skrashevich deleted the fix-ha-2024.4 branch April 5, 2024 21:00
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