Also moved ntfy into devices as it is a quasi device
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
40c0ac5144
commit
58ade33c42
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
|
@ -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>;
|
||||
|
|
|
@ -7,4 +7,3 @@ pub mod error;
|
|||
pub mod event;
|
||||
pub mod messages;
|
||||
pub mod mqtt;
|
||||
pub mod ntfy;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user