From 0e39496c59c049bdb4025e7af9e42f4de2d9e939 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 18 Nov 2022 15:09:57 +0000 Subject: [PATCH] pass payload for call_vendor_request add alias methods for hotkey requests ? perhaps this is not required... --- obsws_python/reqs.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/obsws_python/reqs.py b/obsws_python/reqs.py index 7f15a35..d411b32 100644 --- a/obsws_python/reqs.py +++ b/obsws_python/reqs.py @@ -75,7 +75,7 @@ class ReqClient: """ self.send("BroadcastCustomEvent", eventData) - def call_vendor_request(self, vendorName, requestType, requestData=None): + def call_vendor_request(self, vendor_name, request_type, request_data=None): """ Call a request registered to a vendor. @@ -97,7 +97,10 @@ class ReqClient: """ - return self.send(requestType, requestData) + payload = {"vendorName": vendor_name, "requestType": request_type} + if request_data: + payload["requestData"] = request_data + return self.send("CallVendorRequest", payload) def get_hot_key_list(self): """ @@ -110,6 +113,8 @@ class ReqClient: """ return self.send("GetHotkeyList") + get_hotkey_list = get_hot_key_list + def trigger_hot_key_by_name(self, hotkeyName): """ Triggers a hotkey using its name. For hotkey names @@ -123,6 +128,8 @@ class ReqClient: payload = {"hotkeyName": hotkeyName} self.send("TriggerHotkeyByName", payload) + trigger_hotkey_by_name = trigger_hot_key_by_name + def trigger_hot_key_by_key_sequence( self, keyId, pressShift, pressCtrl, pressAlt, pressCmd ): @@ -155,6 +162,8 @@ class ReqClient: } self.send("TriggerHotkeyByKeySequence", payload) + trigger_hotkey_by_key_sequence = trigger_hot_key_by_key_sequence + def sleep(self, sleepMillis=None, sleepFrames=None): """ Sleeps for a time duration or number of frames.