mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add dbus methods and CLI args for battery charge limit
This commit is contained in:
@@ -22,6 +22,8 @@ struct CLIStart {
|
||||
bright: Option<LedBrightness>,
|
||||
#[options(meta = "FAN", help = "<silent, normal, boost>")]
|
||||
fan_mode: Option<FanLevel>,
|
||||
#[options(meta = "CHRG", help = "<20-100>")]
|
||||
charge_limit: Option<u8>,
|
||||
#[options(command)]
|
||||
command: Option<Command>,
|
||||
}
|
||||
@@ -87,5 +89,11 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
Err(err) => println!("Error: {}", err),
|
||||
}
|
||||
}
|
||||
if let Some(charge_limit) = parsed.charge_limit {
|
||||
match writer.write_charge_limit(charge_limit) {
|
||||
Ok(msg) => println!("Daemon response: {}", msg),
|
||||
Err(err) => println!("Error: {}", err),
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user