summaryrefslogtreecommitdiff
path: root/kvmd/clients
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/clients')
-rw-r--r--kvmd/clients/kvmd.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/clients/kvmd.py b/kvmd/clients/kvmd.py
index 4a996be2..3f258a3b 100644
--- a/kvmd/clients/kvmd.py
+++ b/kvmd/clients/kvmd.py
@@ -170,10 +170,11 @@ class KvmdClientWs:
if writer_task:
writer_task.cancel()
try:
- await self.__ws.close()
+ await asyncio.shield(self.__ws.close())
except Exception:
pass
- self.__communicated = False
+ finally:
+ self.__communicated = False
async def send_key_event(self, key: str, state: bool) -> None:
await self.__writer_queue.put(("key", {"key": key, "state": state}))