Renamed mqtt system to make it more clear that it has to do with mqtt

This commit is contained in:
2022-12-29 00:50:16 +01:00
parent 924b3cf862
commit 458c5e25a3
7 changed files with 46 additions and 42 deletions

View File

@@ -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;

View File

@@ -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;