From b42c4913905229c0eb351bc43785a379a117df98 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 13 May 2021 21:33:08 +0200 Subject: [PATCH] Support for custom timeout on MQTT message publish --- platypush/plugins/zwave/mqtt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/zwave/mqtt.py b/platypush/plugins/zwave/mqtt.py index 1fb12bfa78..d6abaf5809 100644 --- a/platypush/plugins/zwave/mqtt.py +++ b/platypush/plugins/zwave/mqtt.py @@ -46,7 +46,7 @@ class ZwaveMqttPlugin(MqttPlugin, ZwaveBasePlugin): """ def __init__(self, name: str, host: str = 'localhost', port: int = 1883, topic_prefix: str = 'zwave', - timeout: int = 10, tls_certfile: Optional[str] = None, tls_keyfile: Optional[str] = None, + timeout: int = 60, tls_certfile: Optional[str] = None, tls_keyfile: Optional[str] = None, tls_version: Optional[str] = None, tls_ciphers: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, **kwargs): """ @@ -125,7 +125,7 @@ class ZwaveMqttPlugin(MqttPlugin, ZwaveBasePlugin): payload = json.dumps({'args': args}) ret = self._parse_response( self.publish(topic=self._api_topic(api) + '/set', msg=payload, reply_topic=self._api_topic(api), - **self._mqtt_args(**kwargs))) + **self._mqtt_args(**kwargs), timeout=self.timeout)) assert not ret or ret.get('success') is True, ret.get('message') return ret.get('result')