mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
Fix logic
This commit is contained in:
parent
08e58bd60b
commit
6ccabdb747
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user