From 72c7444a45841ad231e04b884d4419d7bc75e8fb Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 23 Oct 2022 18:23:20 +0200 Subject: [PATCH] LINT --- platypush/plugins/mqtt/__init__.py | 6 +++--- platypush/plugins/zwave/mqtt/__init__.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/platypush/plugins/mqtt/__init__.py b/platypush/plugins/mqtt/__init__.py index 20b7034c0..36b52d771 100644 --- a/platypush/plugins/mqtt/__init__.py +++ b/platypush/plugins/mqtt/__init__.py @@ -165,9 +165,9 @@ class MqttPlugin(Plugin): username = username or self.username password = password or self.password - tls_version = tls_version or self.tls_version + tls_version = tls_version or self.tls_version # type: ignore[reportGeneralTypeIssues] if tls_version: - tls_version = self.get_tls_version(tls_version) + tls_version = self.get_tls_version(tls_version) # type: ignore[reportGeneralTypeIssues] if tls_insecure is None: tls_insecure = self.tls_insecure @@ -180,7 +180,7 @@ class MqttPlugin(Plugin): ca_certs=tls_cafile, certfile=tls_certfile, keyfile=tls_keyfile, - tls_version=tls_version, + tls_version=tls_version, # type: ignore[reportGeneralTypeIssues] ciphers=tls_ciphers, ) diff --git a/platypush/plugins/zwave/mqtt/__init__.py b/platypush/plugins/zwave/mqtt/__init__.py index d132f9639..668f09d48 100644 --- a/platypush/plugins/zwave/mqtt/__init__.py +++ b/platypush/plugins/zwave/mqtt/__init__.py @@ -141,13 +141,13 @@ class ZwaveMqttPlugin(MqttPlugin, ZwaveBasePlugin): @staticmethod def _parse_response(response: Union[dict, Response]) -> dict: - if isinstance(response, Response): - response = response.output + rs: dict = ( + response.output if isinstance(response, Response) else response + ) # type: ignore[reportGeneralTypeIssues] - assert response.get('success') is True, response.get( - 'message', 'zwavejs2mqtt error' - ) - return response + assert rs.get('success') is True, rs.get('message', 'zwavejs2mqtt error') + + return rs def _api_request(self, api: str, *args, **kwargs): if len(args) == 1 and isinstance(args[0], dict):