adds support to enable/disable side leds

This commit is contained in:
Martin Piffault
2022-05-31 17:00:21 +02:00
parent b6934bbf63
commit c6caafdcb7
8 changed files with 100 additions and 1 deletions

View File

@@ -59,6 +59,11 @@ pub struct LedModeCommand {
help = "set the keyboard LED suspend animation to enabled while the device is suspended"
)]
pub sleep_enable: Option<bool>,
#[options(
meta = "",
help = "set the keyboard side LEDs to enabled"
)]
pub side_leds_enable: Option<bool>,
#[options(command)]
pub command: Option<SetAuraBuiltin>,
}

View File

@@ -344,6 +344,7 @@ fn handle_led_mode(
&& !mode.next_mode
&& mode.sleep_enable.is_none()
&& mode.awake_enable.is_none()
&& mode.side_leds_enable.is_none()
{
if !mode.help {
println!("Missing arg or command\n");
@@ -407,6 +408,10 @@ fn handle_led_mode(
dbus.proxies().led().set_sleep_enabled(enable)?;
}
if let Some(enable) = mode.side_leds_enable {
dbus.proxies().led().set_side_leds_enabled(enable)?;
}
Ok(())
}