implementing get endpoint for alarms wip
This commit is contained in:
11
src/types.rs
11
src/types.rs
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user