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 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;
|
||||||
|
|
||||||
|
|
|
@ -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,
|
|
@ -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>;
|
||||||
|
|
|
@ -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;
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user