mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Minor prep
This commit is contained in:
@@ -13,9 +13,6 @@ edition.workspace = true
|
||||
name = "asusd"
|
||||
path = "src/daemon.rs"
|
||||
|
||||
[features]
|
||||
tokio_debug = []
|
||||
|
||||
[dependencies]
|
||||
config-traits = { path = "../config-traits" }
|
||||
rog_anime = { path = "../rog-anime", features = ["dbus"] }
|
||||
@@ -30,7 +27,7 @@ inotify.workspace = true
|
||||
|
||||
mio.workspace = true
|
||||
tokio.workspace = true
|
||||
console-subscriber = "0.2.0"
|
||||
# console-subscriber = "0.2.0"
|
||||
|
||||
# cli and logging
|
||||
log.workspace = true
|
||||
|
||||
@@ -219,7 +219,7 @@ impl CtrlKbdLed {
|
||||
if dmi.product_family.contains("TUF") {
|
||||
info!("AuraControl found a TUF laptop keyboard");
|
||||
let ctrl = CtrlKbdLed {
|
||||
led_type: AuraDeviceType::LaptopTuf,
|
||||
led_type: AuraDeviceType::LaptopKeyboardTuf,
|
||||
led_node: LEDNode::KbdLed(kbd_backlight),
|
||||
supported_data: LedSupportData::get_data("tuf"),
|
||||
per_key_mode_active: false,
|
||||
@@ -442,7 +442,7 @@ mod tests {
|
||||
power_zones: vec![PowerZones::Keyboard, PowerZones::RearGlow],
|
||||
};
|
||||
let mut controller = CtrlKbdLed {
|
||||
led_type: AuraDeviceType::LaptopPost2021,
|
||||
led_type: AuraDeviceType::LaptopKeyboard2021,
|
||||
led_node: LEDNode::Rog(
|
||||
Some(KeyboardBacklight::default()),
|
||||
HidRaw::new("19b6").unwrap(),
|
||||
@@ -492,7 +492,7 @@ mod tests {
|
||||
power_zones: vec![PowerZones::Keyboard, PowerZones::RearGlow],
|
||||
};
|
||||
let mut controller = CtrlKbdLed {
|
||||
led_type: AuraDeviceType::LaptopPost2021,
|
||||
led_type: AuraDeviceType::LaptopKeyboard2021,
|
||||
led_node: LEDNode::Rog(
|
||||
Some(KeyboardBacklight::default()),
|
||||
HidRaw::new("19b6").unwrap(),
|
||||
|
||||
@@ -49,8 +49,10 @@ impl CtrlSlash {
|
||||
let usb = USBRaw::new(rog_slash::usb::PROD_ID).ok();
|
||||
let hid = HidRaw::new(rog_slash::usb::PROD_ID_STR).ok();
|
||||
let node = if usb.is_some() {
|
||||
info!("Slash is using raw USB");
|
||||
unsafe { Node::Usb(usb.unwrap_unchecked()) }
|
||||
} else if hid.is_some() {
|
||||
info!("Slash is using HIDRAW");
|
||||
unsafe { Node::Hid(hid.unwrap_unchecked()) }
|
||||
} else {
|
||||
return Err(RogError::Slash(SlashError::NoDevice));
|
||||
|
||||
@@ -19,7 +19,7 @@ use zbus::fdo::ObjectManager;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
console_subscriber::init();
|
||||
// console_subscriber::init();
|
||||
let mut logger = env_logger::Builder::new();
|
||||
logger
|
||||
.parse_default_env()
|
||||
@@ -108,6 +108,8 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
let _ = AuraManager::new(connection.clone()).await?;
|
||||
|
||||
match CtrlSlash::new() {
|
||||
Ok(ctrl) => {
|
||||
let zbus = CtrlSlashZbus(Arc::new(Mutex::new(ctrl)));
|
||||
@@ -123,8 +125,6 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
let _ = AuraManager::new(connection.clone()).await?;
|
||||
|
||||
// Request dbus name after finishing initalizing all functions
|
||||
connection.request_name(DBUS_NAME).await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user