Add fan curve support and profiles

This commit is contained in:
Yarn
2020-09-05 13:54:50 -07:00
parent 772538bc8a
commit 6ba645f727
16 changed files with 383 additions and 116 deletions

View File

@@ -1,6 +1,7 @@
use asus_nb::{
cli_options::{LedBrightness, SetAuraBuiltin},
core_dbus::AuraDbusClient,
profile::{ProfileCommand, ProfileEvent},
};
use daemon::ctrl_fan_cpu::FanLevel;
use gumdrop::Options;
@@ -27,6 +28,8 @@ struct CLIStart {
enum Command {
#[options(help = "Set the keyboard lighting from built-in modes")]
LedMode(LedModeCommand),
#[options(help = "Create and configure profiles")]
Profile(ProfileCommand),
}
#[derive(Options)]
@@ -54,11 +57,18 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let writer = AuraDbusClient::new()?;
if let Some(Command::LedMode(mode)) = parsed.command {
if let Some(command) = mode.command {
writer.write_builtin_mode(&command.into())?
match parsed.command {
Some(Command::LedMode(mode)) => {
if let Some(command) = mode.command {
writer.write_builtin_mode(&command.into())?
}
}
Some(Command::Profile(command)) => {
writer.write_profile_command(&ProfileEvent::Cli(command))?
}
None => (),
}
if let Some(brightness) = parsed.kbd_bright {
writer.write_brightness(brightness.level())?;
}