diff --git a/asusd/src/ctrl_aura/controller.rs b/asusd/src/ctrl_aura/controller.rs index 77e2aaf9..6a90e57b 100644 --- a/asusd/src/ctrl_aura/controller.rs +++ b/asusd/src/ctrl_aura/controller.rs @@ -14,7 +14,7 @@ use rog_platform::keyboard_led::KeyboardLed; use zbus::zvariant::OwnedObjectPath; use super::config::AuraConfig; -use crate::ctrl_aura::manager::dbus_path_for_dev; +use crate::ctrl_aura::manager::{dbus_path_for_dev, dbus_path_for_tuf}; use crate::error::RogError; #[derive(Debug)] @@ -119,6 +119,23 @@ impl CtrlKbdLed { devices.push(dev); } } + + // Check for a TUF laptop LED. Assume there is only ever one. + if let Ok(tuf_kbd) = KeyboardLed::new() { + if tuf_kbd.has_kbd_rgb_mode() { + info!("AuraControl found a TUF laptop keyboard"); + let ctrl = CtrlKbdLed { + led_type: AuraDeviceType::LaptopTuf, + led_node: LEDNode::KbdLed(tuf_kbd), + supported_data: LedSupportData::get_data("tuf"), + per_key_mode_active: false, + config: Self::init_config("tuf"), + dbus_path: dbus_path_for_tuf(), + }; + devices.push(ctrl); + } + } + info!("Found {} Aura devices", devices.len()); Ok(devices) diff --git a/asusd/src/ctrl_aura/manager.rs b/asusd/src/ctrl_aura/manager.rs index 0428a0ef..0bd965ba 100644 --- a/asusd/src/ctrl_aura/manager.rs +++ b/asusd/src/ctrl_aura/manager.rs @@ -46,6 +46,7 @@ impl AuraManager { }; // detect all plugged in aura devices (eventually) + // only USB devices are detected for here spawn_blocking(move || { let mut monitor = MonitorBuilder::new()?.match_subsystem("hidraw")?.listen()?; let mut poll = Poll::new()?; @@ -164,6 +165,10 @@ pub(crate) fn dbus_path_for_dev(parent: &Device) -> Option { None } +pub(crate) fn dbus_path_for_tuf() -> OwnedObjectPath { + ObjectPath::from_str_unchecked(&format!("{AURA_ZBUS_PATH}/tuf")).into() +} + async fn start_tasks( mut zbus: CtrlAuraZbus, connection: Connection,