From 6a39bbd0c352f7e6f06abbecffe6f72536532632 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 3 Nov 2021 08:13:52 -0400 Subject: [PATCH] mqtt: don't publish status updates when disconnected Signed-off-by: Eric Callahan --- moonraker/components/mqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moonraker/components/mqtt.py b/moonraker/components/mqtt.py index b910c5a..a46ee3b 100644 --- a/moonraker/components/mqtt.py +++ b/moonraker/components/mqtt.py @@ -611,7 +611,7 @@ class MQTTClient(APITransport, Subscribable): status: Dict[str, Any], eventtime: float ) -> None: - if not status: + if not status or not self.is_connected(): return payload = {'eventtime': eventtime, 'status': status} self.publish_topic(self.klipper_status_topic, payload)