diff --git a/docs/getting-started.md b/docs/getting-started.md index 6ec57f1b..bc1332aa 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -150,25 +150,31 @@ Use a cloud server when you want to connect through the vendor’s public API. U asyncio.run(main()) ``` + diff --git a/pyoverkiz/action_queue.py b/pyoverkiz/action_queue.py index 8a124686..6c1c4188 100644 --- a/pyoverkiz/action_queue.py +++ b/pyoverkiz/action_queue.py @@ -24,10 +24,10 @@ class ActionQueueSettings: def validate(self) -> None: """Validate configuration values for the action queue.""" if self.delay <= 0: - raise ValueError(f"action_queue_delay must be positive, got {self.delay!r}") + raise ValueError(f"delay must be positive, got {self.delay!r}") if self.max_actions < 1: raise ValueError( - f"action_queue_max_actions must be at least 1, got {self.max_actions!r}" + f"max_actions must be at least 1, got {self.max_actions!r}" ) diff --git a/pyoverkiz/client.py b/pyoverkiz/client.py index 060e5116..df964f8d 100644 --- a/pyoverkiz/client.py +++ b/pyoverkiz/client.py @@ -202,11 +202,12 @@ def __init__( ) -> None: """Constructor. - :param server: ServerConfig - :param credentials: Credentials for authentication - :param verify_ssl: Enable SSL certificate verification - :param session: optional ClientSession - :param settings: behavioral settings for the client (default None) + Args: + server: ServerConfig, Server enum, or server key string. + credentials: Credentials for authentication. + verify_ssl: Enable SSL certificate verification. + session: Optional ClientSession. + settings: Behavioral settings for the client. """ self.server_config = self._normalize_server(server) diff --git a/pyoverkiz/response_handler.py b/pyoverkiz/response_handler.py index 637755ed..5ab94b8a 100644 --- a/pyoverkiz/response_handler.py +++ b/pyoverkiz/response_handler.py @@ -147,7 +147,8 @@ async def check_response(response: ClientResponse) -> None: if error_code: # Error messages between cloud and local servers differ slightly in quoting and punctuation. # Normalise so substring matching works across both variants. - message = message.strip('".') if (message := result.get("error")) else "" + raw_message = result.get("error") + message = raw_message.strip('".') if raw_message else "" # 1. Primary dispatch: match on errorCode (+ optional message substring) for code, pattern, error_class in _ERROR_CODE_MESSAGE_MAP: