forked from platypush/platypush
LINT
This commit is contained in:
parent
951950c864
commit
72c7444a45
2 changed files with 9 additions and 9 deletions
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue