Skip to content

Commit

Permalink
Handle unsub message with no stream id (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
shbatm authored Mar 21, 2023
1 parent 27c0829 commit a3cbcc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyisy/events/tcpsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ def subscribe(self):
def unsubscribe(self):
"""Unsubscribe from the Event Stream."""
if self._subscribed and self._connected:
msg = self._create_message(strings.UNSUB_MSG)
try:
msg = self._create_message(strings.UNSUB_MSG)
self.write(msg)
except OSError as ex:
except (OSError, KeyError) as ex:
_LOGGER.error(
"PyISY encountered a socket error while writing unsubscribe message to the socket: %s.",
ex,
Expand Down

0 comments on commit a3cbcc9

Please sign in to comment.