From bffed55a174eefb1bfb8bea75eaaf4e31035b679 Mon Sep 17 00:00:00 2001 From: Yves Delley Date: Tue, 13 Nov 2018 17:56:59 +0100 Subject: [PATCH] do actually wait for the connection in the mqtt_connection decorator --- hbmqtt/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbmqtt/client.py b/hbmqtt/client.py index b8e8098..262fc06 100644 --- a/hbmqtt/client.py +++ b/hbmqtt/client.py @@ -66,7 +66,7 @@ def mqtt_connected(func): def wrapper(self, *args, **kwargs): if not self._connected_state.is_set(): base_logger.warning("Client not connected, waiting for it") - asyncio.wait([self._connected_state.wait(), self._no_more_connections.wait()], return_when=asyncio.FIRST_COMPLETED) + yield from asyncio.wait([self._connected_state.wait(), self._no_more_connections.wait()], return_when=asyncio.FIRST_COMPLETED) if self._no_more_connections.is_set(): raise ClientException("Will not reconnect") return (yield from func(self, *args, **kwargs))