mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add Ally 1 and X as "old" style devices for power
These have a slightly different power settings data which needs to be verified. We can use the old style for now. Closes #542
This commit is contained in:
@@ -43,23 +43,17 @@ impl KeyboardBacklight {
|
||||
PlatformError::Udev("match_subsystem failed".into(), err)
|
||||
})?;
|
||||
|
||||
enumerator
|
||||
.match_sysname("asus::kbd_backlight")
|
||||
.map_err(|err| {
|
||||
warn!("{}", err);
|
||||
PlatformError::Udev("match_subsystem failed".into(), err)
|
||||
})?;
|
||||
|
||||
if let Some(device) = (enumerator.scan_devices().map_err(|err| {
|
||||
for device in enumerator.scan_devices().map_err(|err| {
|
||||
warn!("{}", err);
|
||||
PlatformError::Udev("scan_devices failed".into(), err)
|
||||
})?)
|
||||
.next()
|
||||
{
|
||||
info!("Found keyboard LED controls at {:?}", device.sysname());
|
||||
return Ok(Self {
|
||||
path: device.syspath().to_owned(),
|
||||
});
|
||||
})? {
|
||||
let sys = device.sysname().to_string_lossy();
|
||||
if sys.contains("kbd_backlight") || sys.contains("ally:rgb:gamepad") {
|
||||
info!("Found keyboard LED controls at {:?}", device.sysname());
|
||||
return Ok(Self {
|
||||
path: device.syspath().to_owned(),
|
||||
});
|
||||
}
|
||||
}
|
||||
Err(PlatformError::MissingFunction(
|
||||
"KeyboardLed:new(), asus::kbd_backlight not found".into(),
|
||||
|
||||
Reference in New Issue
Block a user