Send fan-mode over dbus. Fix multizone dbus command

Closes issue #7
This commit is contained in:
Luke
2020-05-23 14:20:59 +12:00
parent de10fe13e7
commit 46041c0343
9 changed files with 121 additions and 21 deletions

View File

@@ -69,7 +69,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
writer.write_multizone(&byte_arr)?;
}
_ => match writer.write_builtin_mode(&command) {
Ok(msg) => println!("Response: {}", msg),
Ok(msg) => println!("Daemon response: {}", msg),
Err(err) => println!("Error: {}", err),
},
}
@@ -77,7 +77,13 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
if let Some(brightness) = parsed.bright {
match writer.write_brightness(brightness.level()) {
Ok(msg) => println!("Response: {}", msg),
Ok(msg) => println!("Daemon response: {}", msg),
Err(err) => println!("Error: {}", err),
}
}
if let Some(fan_level) = parsed.fan_mode {
match writer.write_fan_mode(fan_level.into()) {
Ok(msg) => println!("Daemon response: {}", msg),
Err(err) => println!("Error: {}", err),
}
}