From 6ccabdb747df7bbcf0f809f5a62268409839ff37 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 25 Oct 2024 06:37:26 -0600 Subject: [PATCH] Fix logic --- frigate/comms/mqtt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frigate/comms/mqtt.py b/frigate/comms/mqtt.py index 02c3cc288..ca9d03da7 100644 --- a/frigate/comms/mqtt.py +++ b/frigate/comms/mqtt.py @@ -27,8 +27,9 @@ class MqttClient(Communicator): # type: ignore[misc] def publish(self, topic: str, payload: Any, retain: bool = False) -> None: """Wrapper for publishing when client is in valid state.""" - if not self.connected and self.started: - logger.error(f"Unable to publish to {topic}: client is not connected") + if not self.connected: + if self.started: + logger.error(f"Unable to publish to {topic}: client is not connected") return self.client.publish(