diff --git a/appmgr/Cargo.toml b/appmgr/Cargo.toml index 5689b05b3..c9537bf58 100644 --- a/appmgr/Cargo.toml +++ b/appmgr/Cargo.toml @@ -38,9 +38,8 @@ path = "src/bin/embassy-cli.rs" [features] avahi = ["avahi-sys"] -default = ["avahi"] -portable = [] -production = [] +default = ["avahi", "sound"] +sound = [] [dependencies] aes = { version = "0.7.5", features = ["ctr"] } diff --git a/appmgr/src/shutdown.rs b/appmgr/src/shutdown.rs index d137d56e8..9c1a5c43f 100644 --- a/appmgr/src/shutdown.rs +++ b/appmgr/src/shutdown.rs @@ -50,18 +50,22 @@ impl Shutdown { #[command(display(display_none))] pub async fn shutdown(#[context] ctx: RpcContext) -> Result<(), Error> { - ctx.shutdown.send(Some(Shutdown { - zfs_pool: ctx.zfs_pool_name.clone(), - restart: false, - })); + ctx.shutdown + .send(Some(Shutdown { + zfs_pool: ctx.zfs_pool_name.clone(), + restart: false, + })) + .expect("receiver dropped"); Ok(()) } #[command(display(display_none))] pub async fn restart(#[context] ctx: RpcContext) -> Result<(), Error> { - ctx.shutdown.send(Some(Shutdown { - zfs_pool: ctx.zfs_pool_name.clone(), - restart: true, - })); + ctx.shutdown + .send(Some(Shutdown { + zfs_pool: ctx.zfs_pool_name.clone(), + restart: true, + })) + .expect("receiver dropped"); Ok(()) } diff --git a/appmgr/src/sound.rs b/appmgr/src/sound.rs index 86cbedb4c..99d075062 100644 --- a/appmgr/src/sound.rs +++ b/appmgr/src/sound.rs @@ -113,12 +113,15 @@ where &'a T: IntoIterator, TimeSlice)>, { pub async fn play(&'a self) -> Result<(), Error> { - let mut sound = SoundInterface::lease().await?; - for (note, slice) in &self.note_sequence { - match note { - None => tokio::time::sleep(slice.to_duration(self.tempo_qpm)).await, - Some(n) => sound.play_for_time_slice(self.tempo_qpm, n, slice).await?, - }; + #[cfg(feature = "sound")] + { + let mut sound = SoundInterface::lease().await?; + for (note, slice) in &self.note_sequence { + match note { + None => tokio::time::sleep(slice.to_duration(self.tempo_qpm)).await, + Some(n) => sound.play_for_time_slice(self.tempo_qpm, n, slice).await?, + }; + } } Ok(()) }