Feature: Schedule devices turning on/off
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-11-17 00:01:13 +01:00
parent 0154d19b71
commit db17b68e90
9 changed files with 144 additions and 3 deletions

17
src/schedule.rs Normal file
View File

@@ -0,0 +1,17 @@
use indexmap::IndexMap;
use serde::Deserialize;
#[derive(Debug, Deserialize, Hash, PartialEq, Eq, Clone, Copy)]
#[serde(rename_all = "snake_case")]
pub enum Action {
On,
Off,
}
pub type Schedule = IndexMap<String, IndexMap<Action, Vec<String>>>;
// #[derive(Debug, Deserialize)]
// pub struct Schedule {
// pub when: String,
// pub actions: IndexMap<Action, Vec<String>>,
// }