Skip to content

Commit

Permalink
subscribe in the connect callback (fixes blakeblackshear#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Feb 20, 2021
1 parent 683c3a4 commit 1a7853a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frigate/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def on_connect(client, userdata, flags, rc):
logger.error("Unable to connect to MQTT: Connection refused. Error code: " + str(rc))

logger.info("MQTT connected")
client.subscribe(f"{mqtt_config.topic_prefix}/#")
client.publish(mqtt_config.topic_prefix+'/available', 'online', retain=True)

client = mqtt.Client(client_id=mqtt_config.client_id)
Expand Down

0 comments on commit 1a7853a

Please sign in to comment.