mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Re-add TUF LED support
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use dmi_id::DMIID;
|
||||
use futures_lite::future::block_on;
|
||||
use log::{debug, error, info, warn};
|
||||
use mio::{Events, Interest, Poll, Token};
|
||||
@@ -163,7 +164,7 @@ impl DeviceManager {
|
||||
}
|
||||
// AURA LAPTOP DEVICE
|
||||
if let Ok(dev_type) = DeviceHandle::maybe_laptop_aura(
|
||||
dev,
|
||||
Some(dev),
|
||||
usb_id.to_str().unwrap_or_default(),
|
||||
)
|
||||
.await
|
||||
@@ -332,6 +333,23 @@ impl DeviceManager {
|
||||
}
|
||||
}
|
||||
|
||||
let board_name = DMIID::new().unwrap_or_default().board_name;
|
||||
if board_name.contains("TUF") {
|
||||
// TUF AURA LAPTOP DEVICE
|
||||
info!("Seems to be a TUF laptop, try using sysfs backlight control");
|
||||
if let Ok(dev_type) = DeviceHandle::maybe_laptop_aura(None, "tuf").await {
|
||||
if let DeviceHandle::Aura(aura) = dev_type.clone() {
|
||||
let path = dbus_path_for_tuf();
|
||||
let ctrl = AuraZbus::new(aura);
|
||||
ctrl.start_tasks(connection, path.clone()).await.unwrap();
|
||||
devices.push(AsusDevice {
|
||||
device: dev_type,
|
||||
dbus_path: path,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(devs) = &mut Self::init_all_scsi(connection).await {
|
||||
devices.append(devs);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ impl DeviceHandle {
|
||||
}
|
||||
|
||||
pub async fn maybe_laptop_aura(
|
||||
device: Arc<Mutex<HidRaw>>,
|
||||
device: Option<Arc<Mutex<HidRaw>>>,
|
||||
prod_id: &str,
|
||||
) -> Result<Self, RogError> {
|
||||
debug!("Testing for laptop aura");
|
||||
@@ -194,7 +194,7 @@ impl DeviceHandle {
|
||||
let mut config = AuraConfig::load_and_update_config(prod_id);
|
||||
config.led_type = aura_type;
|
||||
let aura = Aura {
|
||||
hid: Some(device),
|
||||
hid: device,
|
||||
backlight,
|
||||
config: Arc::new(Mutex::new(config)),
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2024-12-22 03:56+0000\n"
|
||||
"POT-Creation-Date: 2024-12-23 23:59+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
Reference in New Issue
Block a user