From d9600d060798677ea3954e0214896716f48bb370 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Sun, 14 May 2023 10:40:46 +0700 Subject: [PATCH] Filter out OK/FAIL replies --- src/mqtt/mod.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mqtt/mod.rs b/src/mqtt/mod.rs index c2e2071..15e4ab0 100644 --- a/src/mqtt/mod.rs +++ b/src/mqtt/mod.rs @@ -204,6 +204,16 @@ async fn handle_mqtt_message( let mut reply = None; let mut reply_topic = None; match msg.as_ref() { + MqttReplyRef { + topic: _, + message: "OK", + } + | MqttReplyRef { + topic: _, + message: "FAIL", + } => { + // Do nothing for the success/fail replies + } MqttReplyRef { topic: "control/led", message: "on", @@ -297,9 +307,6 @@ async fn handle_mqtt_message( "right" => Direction::Right(amount, seconds), "in" => Direction::In(amount, seconds), "out" => Direction::Out(amount, seconds), - "ok" | "fail" => { - return Ok(()); - } _ => { error!("Unrecognized PTZ direction \"{}\"", direction_txt); return Ok(());