From 219d33a656de7582b3dddd762197a95d293ad95e Mon Sep 17 00:00:00 2001 From: Marton Date: Mon, 24 Jul 2023 10:02:46 +0200 Subject: [PATCH] fix: send disconnect signal on client removal --- setup.py | 2 +- ucapi/api.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f05b26d..d231587 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ PACKAGE_NAME = 'ucapi' HERE = path.abspath(path.dirname(__file__)) -VERSION = '0.0.9' +VERSION = '0.0.10' with open(path.join(HERE, 'README.md'), encoding='utf-8') as f: long_description = f.read() diff --git a/ucapi/api.py b/ucapi/api.py index d33727a..33df3e9 100644 --- a/ucapi/api.py +++ b/ucapi/api.py @@ -158,6 +158,7 @@ async def _handleWs(self, websocket): finally: self._clients.remove(websocket) LOG.info("WS: Client removed") + self.events.emit(uc.EVENTS.DISCONNECT) async def _sendOkResult(self, websocket, id, msgData={}): await self._sendResponse(websocket, id, "result", msgData, 200)