Renamed mqtt system to make it more clear that it has to do with mqtt
This commit is contained in:
@@ -9,7 +9,7 @@ use tokio::task::JoinHandle;
|
||||
|
||||
use crate::config::{KettleConfig, InfoConfig, MqttDeviceConfig};
|
||||
use crate::devices::Device;
|
||||
use crate::mqtt::Listener;
|
||||
use crate::mqtt::OnMqtt;
|
||||
use crate::presence::OnPresence;
|
||||
|
||||
pub struct IkeaOutlet {
|
||||
@@ -69,8 +69,8 @@ impl TryFrom<&Publish> for StateMessage {
|
||||
}
|
||||
}
|
||||
|
||||
impl Listener for IkeaOutlet {
|
||||
fn notify(&mut self, message: &Publish) {
|
||||
impl OnMqtt for IkeaOutlet {
|
||||
fn on_mqtt(&mut self, message: &Publish) {
|
||||
// Update the internal state based on what the device has reported
|
||||
if message.topic != self.mqtt.topic {
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,7 @@ use log::{debug, warn};
|
||||
use rumqttc::{AsyncClient, Publish};
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::{config::{InfoConfig, MqttDeviceConfig}, mqtt::Listener};
|
||||
use crate::{config::{InfoConfig, MqttDeviceConfig}, mqtt::OnMqtt};
|
||||
|
||||
use super::Device;
|
||||
|
||||
@@ -46,8 +46,8 @@ impl TryFrom<&Publish> for StateMessage {
|
||||
}
|
||||
}
|
||||
|
||||
impl Listener for WakeOnLAN {
|
||||
fn notify(&mut self, message: &Publish) {
|
||||
impl OnMqtt for WakeOnLAN {
|
||||
fn on_mqtt(&mut self, message: &Publish) {
|
||||
|
||||
if message.topic != self.mqtt.topic {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user