Skip to content

Commit

Permalink
fix initial switch state
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Jan 21, 2021
1 parent bb4f79c commit 7b4e510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frigate/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def on_connect(client, userdata, flags, rc):

for name in config.cameras.keys():
client.publish(f"{mqtt_config.topic_prefix}/{name}/clips/state", 'ON' if config.cameras[name].clips.enabled else 'OFF', retain=True)
client.publish(f"{mqtt_config.topic_prefix}/{name}/snapshots/state", 'ON' if config.cameras[name].clips.enabled else 'OFF', retain=True)
client.publish(f"{mqtt_config.topic_prefix}/{name}/detect/state", 'ON' if config.cameras[name].clips.enabled else 'OFF', retain=True)
client.publish(f"{mqtt_config.topic_prefix}/{name}/snapshots/state", 'ON' if config.cameras[name].snapshots.enabled else 'OFF', retain=True)
client.publish(f"{mqtt_config.topic_prefix}/{name}/detect/state", 'ON' if config.cameras[name].detect.enabled else 'OFF', retain=True)

client.subscribe(f"{mqtt_config.topic_prefix}/+/clips/set")
client.subscribe(f"{mqtt_config.topic_prefix}/+/snapshots/set")
Expand Down

0 comments on commit 7b4e510

Please sign in to comment.