From 7b4e510b95601a15514c9684f592d18126dcdab0 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Wed, 20 Jan 2021 06:38:55 -0600 Subject: [PATCH] fix initial switch state --- frigate/mqtt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/mqtt.py b/frigate/mqtt.py index 608c62f19..7052025dc 100644 --- a/frigate/mqtt.py +++ b/frigate/mqtt.py @@ -115,8 +115,8 @@ def create_mqtt_client(config: FrigateConfig, camera_metrics): 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")