Skip to content

Websocket#17

Open
dmarc0001 wants to merge 4 commits intomasterfrom
websocket
Open

Websocket#17
dmarc0001 wants to merge 4 commits intomasterfrom
websocket

Conversation

@dmarc0001
Copy link
Copy Markdown

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.

2 participants