version: 0.0.4

feat: parse well-known NUT variables
This commit is contained in:
Aram 🍐 2020-11-18 02:14:53 -05:00
parent 0ba5e4565f
commit 4456922492
6 changed files with 169 additions and 12 deletions

View file

@ -23,15 +23,16 @@ fn main() -> nut_client::Result<()> {
let mut conn = Connection::new(config)?;
// Print a list of all UPS devices and their variables
// Print a list of all UPS devices
println!("Connected UPS devices:");
for (name, description) in conn.list_ups()? {
println!("\t- Name: {}", name);
println!("\t Description: {}", description);
println!("\t Variables:");
for (var_name, var_val) in conn.list_vars(&name)? {
println!("\t\t- {} = {}", var_name, var_val);
// List UPS variables (key = val)
println!("\t Variables:");
for var in conn.list_vars(&name)? {
println!("\t\t- {}", var);
}
}