mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fix and prep new 6.0.2 release
This commit is contained in:
@@ -8,6 +8,7 @@ use std::sync::Arc;
|
||||
use std::thread::sleep;
|
||||
|
||||
use ::zbus::export::futures_util::lock::Mutex;
|
||||
use config_traits::{StdConfig, StdConfigLoad2};
|
||||
use log::{error, info, warn};
|
||||
use rog_anime::error::AnimeError;
|
||||
use rog_anime::usb::{
|
||||
@@ -62,7 +63,7 @@ pub struct CtrlAnime {
|
||||
|
||||
impl CtrlAnime {
|
||||
#[inline]
|
||||
pub fn new(config: AnimeConfig) -> Result<CtrlAnime, RogError> {
|
||||
pub fn new() -> Result<CtrlAnime, RogError> {
|
||||
let usb = USBRaw::new(0x193b).ok();
|
||||
let hid = HidRaw::new("193b").ok();
|
||||
let node = if usb.is_some() {
|
||||
@@ -89,6 +90,7 @@ impl CtrlAnime {
|
||||
// }
|
||||
// }
|
||||
|
||||
let config = AnimeConfig::new().load();
|
||||
let mut anime_type = get_anime_type()?;
|
||||
if let AnimeType::Unknown = anime_type {
|
||||
if let Some(model) = config.model_override {
|
||||
|
||||
@@ -121,12 +121,12 @@ impl CtrlKbdLed {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
if let Ok(kbd_backlight) = KeyboardLed::new() {
|
||||
if kbd_backlight.has_kbd_rgb_mode() {
|
||||
info!("AuraControl found a TUF laptop keyboard");
|
||||
let ctrl = CtrlKbdLed {
|
||||
led_type: AuraDeviceType::LaptopTuf,
|
||||
led_node: LEDNode::KbdLed(tuf_kbd),
|
||||
led_node: LEDNode::KbdLed(kbd_backlight),
|
||||
supported_data: LedSupportData::get_data("tuf"),
|
||||
per_key_mode_active: false,
|
||||
config: Self::init_config("tuf"),
|
||||
|
||||
@@ -720,6 +720,7 @@ impl crate::ZbusRun for CtrlPlatform {
|
||||
impl ReloadAndNotify for CtrlPlatform {
|
||||
type Data = Config;
|
||||
|
||||
/// Called on config file changed externally
|
||||
async fn reload_and_notify(
|
||||
&mut self,
|
||||
signal_context: &SignalContext<'static>,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod config;
|
||||
pub mod trait_impls;
|
||||
|
||||
use config_traits::{StdConfig, StdConfigLoad};
|
||||
use rog_platform::hid_raw::HidRaw;
|
||||
use rog_platform::usb_raw::USBRaw;
|
||||
use rog_slash::error::SlashError;
|
||||
@@ -31,19 +32,13 @@ impl Node {
|
||||
}
|
||||
|
||||
pub struct CtrlSlash {
|
||||
// node: HidRaw,
|
||||
node: Node,
|
||||
config: SlashConfig,
|
||||
// slash_type: SlashType,
|
||||
// // set to force thread to exit
|
||||
// thread_exit: Arc<AtomicBool>,
|
||||
// // Set to false when the thread exits
|
||||
// thread_running: Arc<AtomicBool>,
|
||||
}
|
||||
|
||||
impl CtrlSlash {
|
||||
#[inline]
|
||||
pub fn new(config: SlashConfig) -> Result<CtrlSlash, RogError> {
|
||||
pub fn new() -> Result<CtrlSlash, RogError> {
|
||||
let slash_type = get_slash_type()?;
|
||||
if matches!(slash_type, SlashType::Unknown | SlashType::Unsupported) {
|
||||
return Err(RogError::Slash(SlashError::NoDevice));
|
||||
@@ -61,10 +56,7 @@ impl CtrlSlash {
|
||||
|
||||
let ctrl = CtrlSlash {
|
||||
node,
|
||||
config,
|
||||
// slash_type,
|
||||
// thread_exit: Arc::new(AtomicBool::new(false)),
|
||||
// thread_running: Arc::new(AtomicBool::new(false)),
|
||||
config: SlashConfig::new().load(),
|
||||
};
|
||||
ctrl.do_initialization()?;
|
||||
|
||||
|
||||
@@ -5,17 +5,15 @@ use std::sync::Arc;
|
||||
use ::zbus::export::futures_util::lock::Mutex;
|
||||
use ::zbus::Connection;
|
||||
use asusd::config::Config;
|
||||
use asusd::ctrl_anime::config::AnimeConfig;
|
||||
use asusd::ctrl_anime::trait_impls::CtrlAnimeZbus;
|
||||
use asusd::ctrl_anime::CtrlAnime;
|
||||
use asusd::ctrl_aura::manager::AuraManager;
|
||||
use asusd::ctrl_fancurves::CtrlFanCurveZbus;
|
||||
use asusd::ctrl_platform::CtrlPlatform;
|
||||
use asusd::ctrl_slash::config::SlashConfig;
|
||||
use asusd::ctrl_slash::trait_impls::CtrlSlashZbus;
|
||||
use asusd::ctrl_slash::CtrlSlash;
|
||||
use asusd::{print_board_info, start_tasks, CtrlTask, DBUS_NAME};
|
||||
use config_traits::{StdConfig, StdConfigLoad, StdConfigLoad2, StdConfigLoad3};
|
||||
use config_traits::{StdConfig, StdConfigLoad3};
|
||||
use log::{error, info};
|
||||
use zbus::fdo::ObjectManager;
|
||||
|
||||
@@ -98,7 +96,7 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
match CtrlAnime::new(AnimeConfig::new().load()) {
|
||||
match CtrlAnime::new() {
|
||||
Ok(ctrl) => {
|
||||
let zbus = CtrlAnimeZbus(Arc::new(Mutex::new(ctrl)));
|
||||
let sig_ctx = CtrlAnimeZbus::signal_context(&connection)?;
|
||||
@@ -109,7 +107,7 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
match CtrlSlash::new(SlashConfig::new().load()) {
|
||||
match CtrlSlash::new() {
|
||||
Ok(ctrl) => {
|
||||
let zbus = CtrlSlashZbus(Arc::new(Mutex::new(ctrl)));
|
||||
// Currently, the Slash has no need for a loop watching power events, however,
|
||||
|
||||
Reference in New Issue
Block a user