feat!: Made ntfy notification title required
This commit is contained in:
@@ -48,9 +48,7 @@ struct NotificationFinal {
|
|||||||
|
|
||||||
#[derive(Debug, Serialize, Clone, Deserialize)]
|
#[derive(Debug, Serialize, Clone, Deserialize)]
|
||||||
pub struct Notification {
|
pub struct Notification {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
title: String,
|
||||||
title: Option<String>,
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
message: Option<String>,
|
message: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Vec::is_empty", default = "Default::default")]
|
#[serde(skip_serializing_if = "Vec::is_empty", default = "Default::default")]
|
||||||
tags: Vec<String>,
|
tags: Vec<String>,
|
||||||
@@ -61,16 +59,6 @@ pub struct Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Notification {
|
impl Notification {
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {
|
|
||||||
title: None,
|
|
||||||
message: None,
|
|
||||||
tags: Vec::new(),
|
|
||||||
priority: None,
|
|
||||||
actions: Vec::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn finalize(self, topic: &str) -> NotificationFinal {
|
fn finalize(self, topic: &str) -> NotificationFinal {
|
||||||
NotificationFinal {
|
NotificationFinal {
|
||||||
topic: topic.into(),
|
topic: topic.into(),
|
||||||
@@ -79,12 +67,6 @@ impl Notification {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Notification {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::new()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
#[device_config(default("https://ntfy.sh".into()))]
|
#[device_config(default("https://ntfy.sh".into()))]
|
||||||
|
|||||||
Reference in New Issue
Block a user