diff --git a/automation_devices/src/hue_group.rs b/automation_devices/src/hue_group.rs index fa5b063..8000a40 100644 --- a/automation_devices/src/hue_group.rs +++ b/automation_devices/src/hue_group.rs @@ -120,9 +120,6 @@ impl OnOff for HueGroup { } mod message { - use std::time::Duration; - - use serde::ser::SerializeStruct; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] @@ -164,46 +161,5 @@ mod message { pub fn any_on(&self) -> bool { self.state.any_on } - - // pub fn all_on(&self) -> bool { - // self.state.all_on - // } - } - - #[derive(Debug)] - pub struct Timeout { - timeout: Option, - } - - impl Timeout { - pub fn new(timeout: Option) -> Self { - Self { timeout } - } - } - - impl Serialize for Timeout { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - let len = if self.timeout.is_some() { 2 } else { 1 }; - let mut state = serializer.serialize_struct("TimerMessage", len)?; - if self.timeout.is_some() { - state.serialize_field("status", "enabled")?; - } else { - state.serialize_field("status", "disabled")?; - } - - if let Some(timeout) = self.timeout { - let seconds = timeout.as_secs() % 60; - let minutes = (timeout.as_secs() / 60) % 60; - let hours = timeout.as_secs() / 3600; - - let time = format!("PT{hours:<02}:{minutes:<02}:{seconds:<02}"); - state.serialize_field("localtime", &time)?; - }; - - state.end() - } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 71b5f26..74f7654 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-07-25" +channel = "nightly-2024-12-06" components = ["rustfmt", "clippy", "rust-analyzer"] profile = "minimal"