Skip to content

Commit

Permalink
Filter out OK/FAIL replies
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEntangledAndy committed May 14, 2023
1 parent 72cf358 commit d9600d0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/mqtt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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(());
Expand Down

0 comments on commit d9600d0

Please sign in to comment.