From 9e9073d5da3c7fcd56c408300cd2e71daf9ecf3d Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Tue, 9 May 2023 20:55:29 +0200 Subject: [PATCH] Move raise on MQTT publish outside lock (#92860) * Move raise outside lock * Move log too --- homeassistant/components/mqtt/client.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/mqtt/client.py b/homeassistant/components/mqtt/client.py index 3ae880d2b83..3bd08403b78 100644 --- a/homeassistant/components/mqtt/client.py +++ b/homeassistant/components/mqtt/client.py @@ -465,15 +465,15 @@ class MQTT: msg_info = await self.hass.async_add_executor_job( self._mqttc.publish, topic, payload, qos, retain ) - _LOGGER.debug( - "Transmitting%s message on %s: '%s', mid: %s, qos: %s", - " retained" if retain else "", - topic, - payload, - msg_info.mid, - qos, - ) - _raise_on_error(msg_info.rc) + _LOGGER.debug( + "Transmitting%s message on %s: '%s', mid: %s, qos: %s", + " retained" if retain else "", + topic, + payload, + msg_info.mid, + qos, + ) + _raise_on_error(msg_info.rc) await self._wait_for_mid(msg_info.mid) async def async_connect(self) -> None: