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: Expose HassClientWebSocket in HASSWSApi and EventHandlerSubscription events #17

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

vicfergar
Copy link
Owner

Pass HassClientWebSocket Instance as Event Sender

Problem

Currently, when receiving events from the Home Assistant instance, the SocketEventSubscription instance (an internal implementation detail) is passed as the sender in event handlers. This makes it difficult to access the actual WebSocket connection that received the event.

Solution

Modified the event subscription system to pass the HassClientWebSocket instance as the sender instead of the SocketEventSubscription. This allows users to access the WebSocket connection that received the event and identify which Home Assistant instance triggered it.

Related Issues

Fixes #14 - Determine which HA connection has returned AddEventHandlerSubscriptionAsync event

@vicfergar vicfergar added the enhancement New feature or request label Nov 4, 2024
@vicfergar vicfergar changed the title feat: Expose HassClientWebSocket in HASSWSApi and EventHandlerSubscription events feat: Expose HassClientWebSocket in HASSWSApi and EventHandlerSubscription events Nov 4, 2024
@vicfergar vicfergar merged commit 8184357 into main Nov 4, 2024
2 checks passed
@vicfergar vicfergar deleted the feature/events-sender branch November 15, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

determine which HA connection has returned AddEventHandlerSubscriptionAsync event
1 participant