From 5c70fec29a61f1337f4a53bd78af04ccb2d19683 Mon Sep 17 00:00:00 2001 From: Armas Spann Date: Tue, 4 Apr 2023 01:20:25 +0200 Subject: [PATCH] fix: sleep-animation --- daemon/src/ctrl_anime/config.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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)?);