Filter out OK/FAIL replies

This commit is contained in:
QuantumEntangledAndy committed 2023-05-14 10:40:46 +07:00
1 parent 72cf358b0c
commit d9600d0607
1 file changed
+10 -3
+10 -3
View File
@@ -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(());