implementing get endpoint for alarms wip

This commit is contained in:
2026-03-03 10:00:46 +01:00
parent d8416f3c99
commit a7947a31bc
4 changed files with 70 additions and 24 deletions

View File

@@ -1,6 +1,8 @@
use chrono::{DateTime, Local};
use serde::{Deserialize, Serialize};
use crate::model;
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Alarm {
pub enabled: bool,
@@ -12,3 +14,12 @@ impl Alarm {
Self { enabled, time }
}
}
impl From<model::alarm::Model> for Alarm {
fn from(value: model::alarm::Model) -> Self {
Self {
enabled: value.enabled,
time: DateTime::fromna,
}
}
}