mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
no need to worry about payload here
This commit is contained in:
parent
bb3ba2d572
commit
f892a821f5
@ -90,12 +90,7 @@ def create_mqtt_client(config: FrigateConfig, camera_metrics):
|
||||
client.publish(state_topic, payload, retain=True)
|
||||
|
||||
def on_restart_command(client, userdata, message):
|
||||
payload = message.payload.decode()
|
||||
if payload == "container":
|
||||
logger.warning(f"Restart container received via mqtt")
|
||||
restart_frigate()
|
||||
else:
|
||||
logger.warning(f"Received unsupported value at {message.topic}: {payload}")
|
||||
|
||||
def on_connect(client, userdata, flags, rc):
|
||||
threading.current_thread().name = "mqtt"
|
||||
@ -197,7 +192,7 @@ class MqttSocketRelay:
|
||||
json_message = json.loads(message.data.decode("utf-8"))
|
||||
json_message = {
|
||||
"topic": f"{self.topic_prefix}/{json_message['topic']}",
|
||||
"payload": json_message["payload"],
|
||||
"payload": json_message.get("payload"),
|
||||
"retain": json_message.get("retain", False),
|
||||
}
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user