automation_rs/src/schedule.rs
Dreaded_X db17b68e90
All checks were successful
continuous-integration/drone/push Build is passing
Feature: Schedule devices turning on/off
2023-11-17 00:01:13 +01:00

18 lines
396 B
Rust

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>>,
// }