From 3786739eeedc088aec3ba2a82c27cb13aa0ee5b7 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Wed, 30 Nov 2022 06:11:46 +0000 Subject: [PATCH] send(..., raw=True) returns raw responseData Passing raw=True returns unprocessed responseData payload, allowing for application-level handling of websocket commands unimplemented by the library or for testing. --- obsws_python/reqs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obsws_python/reqs.py b/obsws_python/reqs.py index d411b32..dd36466 100644 --- a/obsws_python/reqs.py +++ b/obsws_python/reqs.py @@ -28,7 +28,7 @@ class ReqClient: def __repr__(self): return type(self).__name__ - def send(self, param, data=None): + def send(self, param, data=None, raw=False): response = self.base_client.req(param, data) if not response["requestStatus"]["result"]: error = ( @@ -38,6 +38,8 @@ class ReqClient: error += (f"With message: {response['requestStatus']['comment']}",) raise OBSSDKError("\n".join(error)) if "responseData" in response: + if raw: + return response["responseData"] return as_dataclass(response["requestType"], response["responseData"]) def get_version(self):