Also moved ntfy into devices as it is a quasi device
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dreaded_X 2023-04-24 04:44:19 +02:00
parent 40c0ac5144
commit 58ade33c42
Signed by: Dreaded_X
GPG Key ID: FA5F485356B0D2D4
5 changed files with 5 additions and 10 deletions

View File

@ -5,6 +5,7 @@ mod hue_bridge;
mod ikea_outlet;
mod kasa_outlet;
mod light_sensor;
mod ntfy;
mod presence;
mod wake_on_lan;
@ -15,6 +16,7 @@ pub use self::hue_bridge::{HueBridge, HueBridgeConfig};
pub use self::ikea_outlet::IkeaOutlet;
pub use self::kasa_outlet::KasaOutlet;
pub use self::light_sensor::{LightSensor, LightSensorConfig};
pub use self::ntfy::{Notification, Ntfy};
pub use self::presence::{Presence, PresenceConfig, DEFAULT_PRESENCE};
pub use self::wake_on_lan::WakeOnLAN;

View File

@ -3,7 +3,6 @@ use std::collections::HashMap;
use async_trait::async_trait;
use serde::Serialize;
use serde_repr::*;
use tokio::sync::mpsc;
use tracing::{debug, error, warn};
use crate::{
@ -13,9 +12,6 @@ use crate::{
event::{OnNotification, OnPresence},
};
pub type Sender = mpsc::Sender<Notification>;
pub type Receiver = mpsc::Receiver<Notification>;
#[derive(Debug)]
pub struct Ntfy {
base_url: String,

View File

@ -4,15 +4,14 @@ use tokio::sync::mpsc;
use impl_cast::device_trait;
use crate::ntfy;
use crate::ntfy::Notification;
use crate::devices::Notification;
#[derive(Debug, Clone)]
pub enum Event {
MqttMessage(Publish),
Darkness(bool),
Presence(bool),
Ntfy(ntfy::Notification),
Ntfy(Notification),
}
pub type Sender = mpsc::Sender<Event>;

View File

@ -7,4 +7,3 @@ pub mod error;
pub mod event;
pub mod messages;
pub mod mqtt;
pub mod ntfy;

View File

@ -9,10 +9,9 @@ use automation::{
auth::{OpenIDConfig, User},
config::Config,
devices,
devices::{DebugBridge, HueBridge, LightSensor, Presence},
devices::{DebugBridge, HueBridge, LightSensor, Ntfy, Presence},
error::ApiError,
mqtt,
ntfy::Ntfy,
};
use dotenvy::dotenv;
use futures::future::join_all;