mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 12:50:53 +00:00
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.
This commit is contained in:
parent
ce6873f57a
commit
3786739eee
@ -28,7 +28,7 @@ class ReqClient:
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return type(self).__name__
|
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)
|
response = self.base_client.req(param, data)
|
||||||
if not response["requestStatus"]["result"]:
|
if not response["requestStatus"]["result"]:
|
||||||
error = (
|
error = (
|
||||||
@ -38,6 +38,8 @@ class ReqClient:
|
|||||||
error += (f"With message: {response['requestStatus']['comment']}",)
|
error += (f"With message: {response['requestStatus']['comment']}",)
|
||||||
raise OBSSDKError("\n".join(error))
|
raise OBSSDKError("\n".join(error))
|
||||||
if "responseData" in response:
|
if "responseData" in response:
|
||||||
|
if raw:
|
||||||
|
return response["responseData"]
|
||||||
return as_dataclass(response["requestType"], response["responseData"])
|
return as_dataclass(response["requestType"], response["responseData"])
|
||||||
|
|
||||||
def get_version(self):
|
def get_version(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user