diff --git a/daemon/src/ctrl_anime/config.rs b/daemon/src/ctrl_anime/config.rs index d3efe467..ce4a5693 100644 --- a/daemon/src/ctrl_anime/config.rs +++ b/daemon/src/ctrl_anime/config.rs @@ -38,7 +38,7 @@ impl From for AnimeConfig { } else { vec![] }, - sleep: if let Some(ani) = c.shutdown { + sleep: if let Some(ani) = c.shutdown.clone() { vec![ani] } else { vec![] @@ -79,6 +79,7 @@ pub struct AnimeConfigV460 { pub system: Vec, pub boot: Vec, pub wake: Vec, + pub sleep: Vec, pub shutdown: Vec, pub brightness: f32, } @@ -89,7 +90,7 @@ impl From for AnimeConfig { system: c.system, boot: c.boot, wake: c.wake, - sleep: c.shutdown.clone(), + sleep: c.sleep, shutdown: c.shutdown, brightness: 1.0, awake_enabled: true, @@ -131,6 +132,12 @@ impl AnimeConfigCached { } self.wake = wake; + let mut sleep = Vec::with_capacity(config.sleep.len()); + for ani in &config.sleep { + sleep.push(ActionData::from_anime_action(anime_type, ani)?); + } + self.sleep = sleep; + let mut shutdown = Vec::with_capacity(config.shutdown.len()); for ani in &config.shutdown { shutdown.push(ActionData::from_anime_action(anime_type, ani)?);