From fef0b44acf295d6db5496ee4d9d4a15979b46b10 Mon Sep 17 00:00:00 2001 From: Kleinrotti Date: Mon, 13 Jun 2022 18:32:27 +0200 Subject: [PATCH] use variable for websocket url instead of string --- src/senertec/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/senertec/client.py b/src/senertec/client.py index 93a1052..6dad33f 100644 --- a/src/senertec/client.py +++ b/src/senertec/client.py @@ -20,6 +20,7 @@ class basesocketclient: def __init__(self, level=logging.WARN): self.logger = logging.getLogger(__name__) self.logger.setLevel(level) + self.WS_HOST = "wss://dachsconnect.senertec.com/ws" self.__is_ws_connected__ = False self.__messages__ = [str()] self.__thread__ = None @@ -87,7 +88,7 @@ def __create_websocket__(self): cookies = self.__getCookies__( self.__session__.cookies, "dachsconnect.senertec.com") self.logger.debug("Creating websocket connection..") - self.ws = websocket.WebSocketApp("wss://dachsconnect.senertec.com/ws", + self.ws = websocket.WebSocketApp(self.WS_HOST, on_message=self.__on_message__, on_error=self.__on_error__, on_close=self.__on_close__,