mqtt: don't publish status updates when disconnected
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
eec60a760b
commit
6a39bbd0c3
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue