Use other to string in CLI app

This commit is contained in:
Lennard Kittner
2025-03-22 12:22:56 +01:00
parent d5fcc8286c
commit 9a4f3805dc

View File

@@ -3,6 +3,7 @@ use std::time::Duration;
use clap::{Arg, Command}; use clap::{Arg, Command};
use hyper_x_cloud_ii_wireless::devices::{cloud_ii_wireless_dts::CloudIIWirelessDTS, Device}; use hyper_x_cloud_ii_wireless::devices::{cloud_ii_wireless_dts::CloudIIWirelessDTS, Device};
//TODO: error handling e.g. reconnect on "no such device" error
fn main() { fn main() {
let matches = Command::new(env!("CARGO_PKG_NAME")) let matches = Command::new(env!("CARGO_PKG_NAME"))
.version(env!("CARGO_PKG_VERSION")) .version(env!("CARGO_PKG_VERSION"))
@@ -114,7 +115,10 @@ fn main() {
eprintln!("{error}"); eprintln!("{error}");
std::process::exit(1); std::process::exit(1);
}; };
println!("Device State: {}", device.get_device_state()); println!(
"Device State: \n{}",
device.get_device_state().to_better_string()
);
} }
#[test] #[test]