From 330a0983f925a5c155f494faed1554ce2e952e2b Mon Sep 17 00:00:00 2001 From: Aaska Black Wolf Date: Wed, 8 Jul 2026 19:07:03 +0200 Subject: [PATCH] cleanup --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a51b940..492e7a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,8 +43,9 @@ fn main () { match action { "on" => pin_switch_on(), "off" => pin_switch_off(), + "status" => println!("Inverter status: {}" , if pin_status() == 0 { "off" } else { "on" }), "test" => pin_test(&config), - &_ => println!("So far only the parameters 'on', 'off' and 'test' are supported.") + _ => println!("So far only the parameters 'on', 'off', status and 'test' are supported.") } } else { // no command line parameter set; check for voltages and switch the inverter accordingly @@ -101,7 +102,7 @@ fn get_current_voltage (config: &Config) -> f32 { } let db_connection = sqlite::open(&config.database).unwrap(); - let query = format!("SELECT data FROM '{device}' ORDER BY date DESC, time DESC LIMIT 1;", device = &config.device_name_voltage); + let query = format!("SELECT data FROM '{device}' ORDER BY date DESC, time DESC LIMIT 1;", device = config.device_name_voltage); let _ = db_connection.iterate(query, |pairs | { let data = pairs.get(0).unwrap().1.unwrap();