mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fixups
This commit is contained in:
@@ -109,7 +109,7 @@ impl CtrlKbdLed {
|
|||||||
conn: Connection,
|
conn: Connection,
|
||||||
) -> Result<(), RogError> {
|
) -> Result<(), RogError> {
|
||||||
let dbus_path = self.dbus_path.clone();
|
let dbus_path = self.dbus_path.clone();
|
||||||
interfaces.insert(dbus_path.clone());
|
let dbus_path_cpy = self.dbus_path.clone();
|
||||||
info!(
|
info!(
|
||||||
"AuraManager starting device at: {:?}, {:?}",
|
"AuraManager starting device at: {:?}, {:?}",
|
||||||
dbus_path, self.led_type
|
dbus_path, self.led_type
|
||||||
@@ -121,6 +121,7 @@ impl CtrlKbdLed {
|
|||||||
tokio::spawn(
|
tokio::spawn(
|
||||||
async move { start_tasks(zbus, conn_copy.clone(), sig_ctx2, dbus_path).await },
|
async move { start_tasks(zbus, conn_copy.clone(), sig_ctx2, dbus_path).await },
|
||||||
);
|
);
|
||||||
|
interfaces.insert(dbus_path_cpy);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +135,7 @@ impl CtrlKbdLed {
|
|||||||
if let Some(usb_device) = device.parent_with_subsystem_devtype("usb", "usb_device")? {
|
if let Some(usb_device) = device.parent_with_subsystem_devtype("usb", "usb_device")? {
|
||||||
let dbus_path = dbus_path_for_dev(&usb_device).unwrap_or_default();
|
let dbus_path = dbus_path_for_dev(&usb_device).unwrap_or_default();
|
||||||
if interfaces.contains(&dbus_path) {
|
if interfaces.contains(&dbus_path) {
|
||||||
debug!("Already a ctrl at {dbus_path:?}");
|
debug!("Already a ctrl at {dbus_path:?}, ignoring this end-point");
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ pub mod trait_impls;
|
|||||||
pub(super) fn filename_partial(parent: &Device) -> Option<OwnedObjectPath> {
|
pub(super) fn filename_partial(parent: &Device) -> Option<OwnedObjectPath> {
|
||||||
if let Some(id_product) = parent.attribute_value("idProduct") {
|
if let Some(id_product) = parent.attribute_value("idProduct") {
|
||||||
let id_product = id_product.to_string_lossy();
|
let id_product = id_product.to_string_lossy();
|
||||||
let path = if let Some(devnum) = parent.attribute_value("devnum") {
|
let mut path = if let Some(devnum) = parent.attribute_value("devnum") {
|
||||||
let devnum = devnum.to_string_lossy();
|
let devnum = devnum.to_string_lossy();
|
||||||
if let Some(devpath) = parent.attribute_value("devpath") {
|
if let Some(devpath) = parent.attribute_value("devpath") {
|
||||||
let devpath = devpath.to_string_lossy();
|
let devpath = devpath.to_string_lossy();
|
||||||
@@ -26,8 +26,9 @@ pub(super) fn filename_partial(parent: &Device) -> Option<OwnedObjectPath> {
|
|||||||
};
|
};
|
||||||
if path.contains('.') {
|
if path.contains('.') {
|
||||||
warn!("dbus path for {id_product} contains `.`, removing");
|
warn!("dbus path for {id_product} contains `.`, removing");
|
||||||
|
path = path.replace('.', "").to_owned();
|
||||||
}
|
}
|
||||||
return Some(ObjectPath::from_str_unchecked(path.trim_matches('.')).into());
|
return Some(ObjectPath::from_str_unchecked(&path).into());
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user