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

Replace check_ws with subcription to websocket state #165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jimmydoh
Copy link

uilibs/uiprotect@d7083ab removed check_ws, migrating the functionality to a websocket state subscription.

This PR adds the subscription, a callback to update self._websocket_state upon any state changes and replaces check_ws with self._websocket_state.

Continuation of discussions in PR #164

@ep1cman
Copy link
Owner

ep1cman commented Sep 17, 2024

If the websocket is already connected by the time the event listener starts its internal state would be stuck on disconnected until the websocket disconnects and a reconnection is triggered?

I also don't think _check_websocket_and_reconnect needs to be run every 60s anymore because we can get a callback when the web socket disconnects

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