We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b854022 commit d44492eCopy full SHA for d44492e
heos-lib/src/heos_group.rs
@@ -9,8 +9,10 @@
9
/// See the file LICENSE for details.
10
///
11
12
+use crate::heos_command::{HeosCommand, HeosCommandHandler};
13
+use crate::{HeosDevice, HeosReply};
14
+use anyhow::{anyhow, Result};
15
use std::fmt::{Display, Formatter};
-use crate::HeosDevice;
16
17
#[derive(Debug)]
18
pub struct HeosGroup {
@@ -31,6 +33,17 @@ impl HeosGroup {
31
33
}
32
34
35
36
+impl HeosCommandHandler for HeosGroup {
37
+ async fn send_command<'a>(&mut self, cmd: &HeosCommand<'a>) -> Result<HeosReply> {
38
+ match self.leader {
39
+ Some(ref mut leader) => {
40
+ Ok(leader.send_command(cmd).await?)
41
+ },
42
+ None => Err(anyhow!("No leader found")),
43
+ }
44
45
+}
46
+
47
impl Clone for HeosGroup {
48
fn clone(&self) -> Self {
49
Self {
0 commit comments