From 89b5d7dca25c734cb08a08e933f5f5abaac67c2a Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Tue, 8 Aug 2023 20:37:28 +0530 Subject: [PATCH] Fixed send_data method for websocket --- py5paisa/py5paisa.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py5paisa/py5paisa.py b/py5paisa/py5paisa.py index 14eba2b9..9902a131 100644 --- a/py5paisa/py5paisa.py +++ b/py5paisa/py5paisa.py @@ -476,9 +476,12 @@ def on_open(ws): except Exception as e: log_response(e) - def send_data(self, open_: any): + def send_data(self, wspayload: dict): try: - self.ws.on_open = open_ + if self.ws is not None: + self.ws.send(json.dumps(wspayload)) + else: + log_response("Websocket Connection not established call connect method first") except Exception as e: log_response(e)