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

View File

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

View File

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

View File

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

View File

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