Compare commits

..

No commits in common. "ca72b92eb38c33d2a7d8dc299c8d3d742d104663" and "24f8487d93eb60b0aed48b8808496a57759e8feb" have entirely different histories.

5 changed files with 8 additions and 31 deletions

5
.gitignore vendored
View File

@ -45,11 +45,6 @@ env.bak/
venv.bak/
.hatch
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version
# Test/config
quick.py
config.toml

View File

@ -108,15 +108,9 @@ class ObsClient:
self.ws.send(json.dumps(payload))
try:
response = json.loads(self.ws.recv())
if response["op"] != 2:
raise OBSSDKError(
"failed to identify client with the server, expected response with OpCode 2 Identified"
)
return response["d"]
return response["op"] == 2
except json.decoder.JSONDecodeError:
raise OBSSDKError(
"failed to identify client with the server, please check connection settings"
)
raise OBSSDKError("failed to identify client with the server")
def req(self, req_type, req_data=None):
payload = {

View File

@ -7,7 +7,7 @@ from websocket import WebSocketTimeoutException
from .baseclient import ObsClient
from .callback import Callback
from .error import OBSSDKError, OBSSDKTimeoutError
from .error import OBSSDKTimeoutError
from .subs import Subs
"""
@ -27,14 +27,8 @@ class EventClient:
defaultkwargs = {"subs": Subs.LOW_VOLUME}
kwargs = defaultkwargs | kwargs
self.base_client = ObsClient(**kwargs)
try:
success = self.base_client.authenticate()
self.logger.info(
f"Successfully identified {self} with the server using RPC version:{success['negotiatedRpcVersion']}"
)
except OBSSDKError as e:
self.logger.error(f"{type(e).__name__}: {e}")
raise
if self.base_client.authenticate():
self.logger.info(f"Successfully identified {self} with the server")
self.callback = Callback()
self.subscribe()

View File

@ -17,14 +17,8 @@ class ReqClient:
def __init__(self, **kwargs):
self.logger = logger.getChild(self.__class__.__name__)
self.base_client = ObsClient(**kwargs)
try:
success = self.base_client.authenticate()
self.logger.info(
f"Successfully identified {self} with the server using RPC version:{success['negotiatedRpcVersion']}"
)
except OBSSDKError as e:
self.logger.error(f"{type(e).__name__}: {e}")
raise
if self.base_client.authenticate():
self.logger.info(f"Successfully identified {self} with the server")
def __enter__(self):
return self

View File

@ -1 +1 @@
version = "1.5.2"
version = "1.5.1"