This commit is contained in:
Fabio Manganiello 2022-10-23 18:23:20 +02:00
parent 951950c864
commit 72c7444a45
Signed by: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 9 additions and 9 deletions

View file

@ -165,9 +165,9 @@ class MqttPlugin(Plugin):
username = username or self.username username = username or self.username
password = password or self.password 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: 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: if tls_insecure is None:
tls_insecure = self.tls_insecure tls_insecure = self.tls_insecure
@ -180,7 +180,7 @@ class MqttPlugin(Plugin):
ca_certs=tls_cafile, ca_certs=tls_cafile,
certfile=tls_certfile, certfile=tls_certfile,
keyfile=tls_keyfile, keyfile=tls_keyfile,
tls_version=tls_version, tls_version=tls_version, # type: ignore[reportGeneralTypeIssues]
ciphers=tls_ciphers, ciphers=tls_ciphers,
) )

View file

@ -141,13 +141,13 @@ class ZwaveMqttPlugin(MqttPlugin, ZwaveBasePlugin):
@staticmethod @staticmethod
def _parse_response(response: Union[dict, Response]) -> dict: def _parse_response(response: Union[dict, Response]) -> dict:
if isinstance(response, Response): rs: dict = (
response = response.output response.output if isinstance(response, Response) else response
) # type: ignore[reportGeneralTypeIssues]
assert response.get('success') is True, response.get( assert rs.get('success') is True, rs.get('message', 'zwavejs2mqtt error')
'message', 'zwavejs2mqtt error'
) return rs
return response
def _api_request(self, api: str, *args, **kwargs): def _api_request(self, api: str, *args, **kwargs):
if len(args) == 1 and isinstance(args[0], dict): if len(args) == 1 and isinstance(args[0], dict):