feat!: Made ntfy notification title required
All checks were successful
Build and deploy / build (push) Successful in 12m26s
Build and deploy / Deploy container (push) Successful in 43s

This commit is contained in:
2025-09-13 04:04:51 +02:00
parent 8982e9c165
commit 580a5187bd

View File

@@ -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()))]