Moved the mqtt topic check up one leve into Devices
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-04-12 04:49:45 +02:00
parent 92c8f3074f
commit 11aa15b59d
5 changed files with 13 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
use std::time::Duration;
use async_trait::async_trait;
use rumqttc::{matches, AsyncClient};
use rumqttc::AsyncClient;
use tokio::task::JoinHandle;
use tracing::{debug, error, warn};
@@ -64,10 +64,6 @@ impl OnMqtt for ContactSensor {
}
async fn on_mqtt(&mut self, message: &rumqttc::Publish) {
if !matches(&message.topic, &self.mqtt.topic) {
return;
}
let is_closed = match ContactMessage::try_from(message) {
Ok(state) => state.is_closed(),
Err(err) => {