play/play.rs
1use alienrgb::{AnimationSub, Commands, Elc};
2
3fn main() {
4 let animation_id: u16 = std::env::var("ANIMATION_ID")
5 .unwrap_or("1".to_owned())
6 .parse()
7 .unwrap_or(1);
8 let mut elc = Elc::new();
9 play(&mut elc, animation_id).unwrap();
10}
11
12fn play(elc: &mut Elc, id: u16) -> Result<(), rusb::Error> {
13 let command = Commands::Animation(AnimationSub::Play, id);
14 let status = elc.execute(&command)?;
15 println!("{command:#?}:\n{status:#?}");
16 Ok(())
17}