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

Websocket #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Websocket #17

wants to merge 4 commits into from

Conversation

dmarc0001
Copy link

Hi!
i have an suggestion:

it was necessary the websocket thread to close.
my suggestion is, the var _ws_client make objectwide visible (to self._ws_client).
Make an function to close the notitication by example:

class SoundTouchDevice:

def __init__(self, host, port=8090, ws_port=8080, dlna_port=8091):
  ...
   self._ws_client = None

def __del__(self):
    if self.ws_thread is not None:
        self._ws_client.close()
        self.ws_thread = None

def stop_notification(self):
    if self._ws_client is not None:
        self._ws_client.close()

my problem was, the thread for notification ends never, although the thread to control the device(s) endet. So the Thread to control my device also not endet.... (join())

Dirk

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.

None yet

2 participants