mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
Bugfix release
This commit is contained in:
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v5.0.3]
|
||||
### Changed
|
||||
- Fix and error in platform ppt value gets
|
||||
- Fix to asusctl CLI where an incorrect enum variant was used in throttle check
|
||||
- Turn some error messages in to warning or info to prevent confusion
|
||||
- Re-add the keyboard power settings in rogcc
|
||||
- Add two new aura dbus properties for providing some basic info on aura modes/power
|
||||
|
||||
## [v5.0.2]
|
||||
### Changed
|
||||
- Fan-curves: nuke a few async deadlocks
|
||||
|
||||
26
Cargo.lock
generated
26
Cargo.lock
generated
@@ -199,7 +199,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
||||
|
||||
[[package]]
|
||||
name = "asusctl"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"cargo-husky",
|
||||
@@ -218,7 +218,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusd"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"cargo-husky",
|
||||
@@ -243,7 +243,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusd-user"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"config-traits",
|
||||
@@ -846,7 +846,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "config-traits"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"log",
|
||||
@@ -899,7 +899,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cpuctl"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
@@ -1026,7 +1026,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dmi_id"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"log",
|
||||
"udev",
|
||||
@@ -2846,7 +2846,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||
|
||||
[[package]]
|
||||
name = "rog-control-center"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"cargo-husky",
|
||||
@@ -2879,7 +2879,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_anime"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"dmi_id",
|
||||
@@ -2896,7 +2896,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_aura"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"dmi_id",
|
||||
@@ -2910,7 +2910,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_dbus"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"cargo-husky",
|
||||
@@ -2923,7 +2923,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_platform"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"concat-idents",
|
||||
@@ -2940,7 +2940,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_profiles"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"log",
|
||||
@@ -2954,7 +2954,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_simulators"
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
dependencies = [
|
||||
"glam",
|
||||
"log",
|
||||
|
||||
@@ -4,7 +4,7 @@ default-members = ["asusctl", "asusd", "asusd-user", "cpuctl", "rog-control-cent
|
||||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
version = "5.0.2"
|
||||
version = "5.0.3"
|
||||
|
||||
[workspace.dependencies]
|
||||
async-trait = "^0.1"
|
||||
|
||||
@@ -421,7 +421,7 @@ fn handle_led_mode(
|
||||
if let Some(cmdlist) = LedModeCommand::command_list() {
|
||||
let commands: Vec<String> = cmdlist.lines().map(|s| s.to_owned()).collect();
|
||||
for command in commands.iter().filter(|command| {
|
||||
let modes = dbus.proxies().aura().supported_modes().unwrap();
|
||||
let modes = dbus.proxies().aura().supported_basic_modes().unwrap();
|
||||
for mode in &modes {
|
||||
if command
|
||||
.trim()
|
||||
@@ -450,7 +450,7 @@ fn handle_led_mode(
|
||||
}
|
||||
if mode.next_mode {
|
||||
let mode = dbus.proxies().aura().led_mode()?;
|
||||
let modes = dbus.proxies().aura().supported_modes()?;
|
||||
let modes = dbus.proxies().aura().supported_basic_modes()?;
|
||||
let mut pos = modes.iter().position(|m| *m == mode).unwrap() + 1;
|
||||
if pos >= modes.len() {
|
||||
pos = 0;
|
||||
@@ -458,7 +458,7 @@ fn handle_led_mode(
|
||||
dbus.proxies().aura().set_led_mode(modes[pos])?;
|
||||
} else if mode.prev_mode {
|
||||
let mode = dbus.proxies().aura().led_mode()?;
|
||||
let modes = dbus.proxies().aura().supported_modes()?;
|
||||
let modes = dbus.proxies().aura().supported_basic_modes()?;
|
||||
let mut pos = modes.iter().position(|m| *m == mode).unwrap();
|
||||
if pos == 0 {
|
||||
pos = modes.len() - 1;
|
||||
@@ -662,7 +662,7 @@ fn handle_throttle_profile(
|
||||
supported: &[Properties],
|
||||
cmd: &ProfileCommand,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if !supported.contains(&Properties::DgpuDisable) {
|
||||
if !supported.contains(&Properties::PlatformPolicy) {
|
||||
println!("Profiles not supported by either this kernel or by the laptop.");
|
||||
return Err(ProfileError::NotSupported.into());
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ pub struct CtrlKbdLed {
|
||||
pub led_prod: AuraDevice,
|
||||
pub led_node: LEDNode,
|
||||
pub sysfs_node: KeyboardLed,
|
||||
pub supported_modes: LaptopLedData,
|
||||
pub supported_data: LaptopLedData,
|
||||
pub per_key_mode_active: bool,
|
||||
pub config: AuraConfig,
|
||||
}
|
||||
|
||||
impl CtrlKbdLed {
|
||||
pub fn new(supported_modes: LaptopLedData) -> Result<Self, RogError> {
|
||||
pub fn new(supported_basic_modes: LaptopLedData) -> Result<Self, RogError> {
|
||||
let mut led_prod = AuraDevice::Unknown;
|
||||
let mut usb_node = None;
|
||||
for prod in ASUS_KEYBOARD_DEVICES {
|
||||
@@ -97,7 +97,7 @@ impl CtrlKbdLed {
|
||||
let mut new_set = Vec::new();
|
||||
// only reuse a zone mode if the mode is supported
|
||||
for mode in loaded {
|
||||
if supported_modes.basic_modes.contains(&mode.mode) {
|
||||
if supported_basic_modes.basic_modes.contains(&mode.mode) {
|
||||
new_set.push(mode.clone());
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ impl CtrlKbdLed {
|
||||
led_prod,
|
||||
led_node, // on TUF this is the same as rgb_led / kd_brightness
|
||||
sysfs_node: rgb_led, // If was none then we already returned above
|
||||
supported_modes,
|
||||
supported_data: supported_basic_modes,
|
||||
per_key_mode_active: false,
|
||||
config: config_loaded,
|
||||
};
|
||||
@@ -245,7 +245,7 @@ impl CtrlKbdLed {
|
||||
/// exists.
|
||||
fn create_multizone_default(&mut self) -> Result<(), RogError> {
|
||||
let mut default = vec![];
|
||||
for (i, tmp) in self.supported_modes.basic_zones.iter().enumerate() {
|
||||
for (i, tmp) in self.supported_data.basic_zones.iter().enumerate() {
|
||||
default.push(AuraEffect {
|
||||
mode: self.config.current_mode,
|
||||
zone: *tmp,
|
||||
@@ -285,7 +285,7 @@ mod tests {
|
||||
fn create_multizone_if_no_config() {
|
||||
// Checking to ensure set_mode errors when unsupported modes are tried
|
||||
let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default());
|
||||
let supported_modes = LaptopLedData {
|
||||
let supported_basic_modes = LaptopLedData {
|
||||
board_name: String::new(),
|
||||
layout_name: "ga401".to_owned(),
|
||||
basic_modes: vec![AuraModeNum::Static],
|
||||
@@ -297,7 +297,7 @@ mod tests {
|
||||
led_prod: AuraDevice::X19b6,
|
||||
led_node: LEDNode::None,
|
||||
sysfs_node: KeyboardLed::default(),
|
||||
supported_modes,
|
||||
supported_data: supported_basic_modes,
|
||||
per_key_mode_active: false,
|
||||
config,
|
||||
};
|
||||
@@ -306,8 +306,8 @@ mod tests {
|
||||
assert!(controller.create_multizone_default().is_err());
|
||||
assert!(controller.config.multizone.is_none());
|
||||
|
||||
controller.supported_modes.basic_zones.push(AuraZone::Key1);
|
||||
controller.supported_modes.basic_zones.push(AuraZone::Key2);
|
||||
controller.supported_data.basic_zones.push(AuraZone::Key1);
|
||||
controller.supported_data.basic_zones.push(AuraZone::Key2);
|
||||
assert!(controller.create_multizone_default().is_ok());
|
||||
assert!(controller.config.multizone.is_some());
|
||||
|
||||
@@ -323,7 +323,7 @@ mod tests {
|
||||
fn next_mode_create_multizone_if_no_config() {
|
||||
// Checking to ensure set_mode errors when unsupported modes are tried
|
||||
let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default());
|
||||
let supported_modes = LaptopLedData {
|
||||
let supported_basic_modes = LaptopLedData {
|
||||
board_name: String::new(),
|
||||
layout_name: "ga401".to_owned(),
|
||||
basic_modes: vec![AuraModeNum::Static],
|
||||
@@ -335,7 +335,7 @@ mod tests {
|
||||
led_prod: AuraDevice::X19b6,
|
||||
led_node: LEDNode::None,
|
||||
sysfs_node: KeyboardLed::default(),
|
||||
supported_modes,
|
||||
supported_data: supported_basic_modes,
|
||||
per_key_mode_active: false,
|
||||
config,
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ use async_trait::async_trait;
|
||||
use config_traits::StdConfig;
|
||||
use log::{debug, error, info, warn};
|
||||
use rog_aura::advanced::UsbPackets;
|
||||
use rog_aura::aura_detection::PowerZones;
|
||||
use rog_aura::usb::{AuraDevice, AuraPowerDev};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
|
||||
use zbus::export::futures_util::lock::{Mutex, MutexGuard};
|
||||
@@ -78,11 +79,23 @@ impl CtrlAuraZbus {
|
||||
|
||||
/// The total available modes
|
||||
#[dbus_interface(property)]
|
||||
async fn supported_modes(&self) -> Result<Vec<AuraModeNum>, ZbErr> {
|
||||
async fn supported_basic_modes(&self) -> Result<Vec<AuraModeNum>, ZbErr> {
|
||||
let ctrl = self.0.lock().await;
|
||||
Ok(ctrl.config.builtins.keys().cloned().collect())
|
||||
}
|
||||
|
||||
#[dbus_interface(property)]
|
||||
async fn supported_basic_zones(&self) -> Result<Vec<AuraZone>, ZbErr> {
|
||||
let ctrl = self.0.lock().await;
|
||||
Ok(ctrl.supported_data.basic_zones.clone())
|
||||
}
|
||||
|
||||
#[dbus_interface(property)]
|
||||
async fn supported_power_zones(&self) -> Result<Vec<PowerZones>, ZbErr> {
|
||||
let ctrl = self.0.lock().await;
|
||||
Ok(ctrl.supported_data.power_zones.clone())
|
||||
}
|
||||
|
||||
/// The current mode data
|
||||
#[dbus_interface(property)]
|
||||
async fn led_mode(&self) -> Result<AuraModeNum, ZbErr> {
|
||||
@@ -126,9 +139,9 @@ impl CtrlAuraZbus {
|
||||
#[dbus_interface(property)]
|
||||
async fn set_led_mode_data(&mut self, effect: AuraEffect) -> Result<(), ZbErr> {
|
||||
let mut ctrl = self.0.lock().await;
|
||||
if !ctrl.supported_modes.basic_modes.contains(&effect.mode)
|
||||
if !ctrl.supported_data.basic_modes.contains(&effect.mode)
|
||||
|| effect.zone != AuraZone::None
|
||||
&& !ctrl.supported_modes.basic_zones.contains(&effect.zone)
|
||||
&& !ctrl.supported_data.basic_zones.contains(&effect.zone)
|
||||
{
|
||||
return Err(ZbErr::NotSupported(format!(
|
||||
"The Aura effect is not supported: {effect:?}"
|
||||
|
||||
@@ -229,12 +229,10 @@ impl CtrlFanCurveZbus {
|
||||
.unwrap_or(PlatformPolicy::Balanced.into());
|
||||
|
||||
self.platform.set_throttle_thermal_policy(profile.into())?;
|
||||
{
|
||||
self.fan_curves
|
||||
.lock()
|
||||
.await
|
||||
.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
|
||||
}
|
||||
self.platform.set_throttle_thermal_policy(active)?;
|
||||
|
||||
self.update_config_from_profiles().await;
|
||||
|
||||
@@ -33,7 +33,7 @@ macro_rules! platform_get_value {
|
||||
})
|
||||
})
|
||||
} else {
|
||||
error!("RogPlatform: {} not supported", $prop_name);
|
||||
info!("RogPlatform: {} not supported", $prop_name);
|
||||
return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name)));
|
||||
}
|
||||
})
|
||||
@@ -45,9 +45,9 @@ macro_rules! platform_get_value_if_some {
|
||||
concat_idents::concat_idents!(has = has_, $property {
|
||||
if $self.platform.has() {
|
||||
let lock = $self.config.lock().await;
|
||||
Ok(lock.ppt_pl1_spl.unwrap_or($default))
|
||||
Ok(lock.$property.unwrap_or($default))
|
||||
} else {
|
||||
error!("RogPlatform: {} not supported", $prop_name);
|
||||
info!("RogPlatform: {} not supported", $prop_name);
|
||||
return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name)));
|
||||
}
|
||||
})
|
||||
@@ -69,7 +69,7 @@ macro_rules! platform_set_bool {
|
||||
lock.write();
|
||||
Ok(())
|
||||
} else {
|
||||
error!("RogPlatform: {} not supported", $prop_name);
|
||||
info!("RogPlatform: {} not supported", $prop_name);
|
||||
Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name)))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@ pub struct LedSupportFile(Vec<LaptopLedData>);
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "s")
|
||||
zvariant(signature = "u")
|
||||
)]
|
||||
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Default, Copy, Clone)]
|
||||
pub enum PowerZones {
|
||||
|
||||
@@ -303,7 +303,7 @@ impl From<AuraEffect> for AuraModeNum {
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
zvariant(signature = "s")
|
||||
zvariant(signature = "u")
|
||||
)]
|
||||
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub enum AuraZone {
|
||||
|
||||
@@ -202,7 +202,9 @@ fn main() -> Result<()> {
|
||||
"ROG Control Center",
|
||||
native_options.clone(),
|
||||
Box::new(move |cc| {
|
||||
Box::new(RogApp::new(Config::load().unwrap(), states, cc).unwrap())
|
||||
let cfg = Config::load().unwrap();
|
||||
let app = RogApp::new(cfg, states, cc);
|
||||
Box::new(app.unwrap())
|
||||
}),
|
||||
)?;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::system_state::SystemState;
|
||||
use crate::widgets::{anime_power_group, platform_profile, rog_bios_group};
|
||||
use crate::widgets::{anime_power_group, aura_power_group, platform_profile, rog_bios_group};
|
||||
use crate::RogApp;
|
||||
|
||||
impl RogApp {
|
||||
@@ -22,7 +22,7 @@ impl RogApp {
|
||||
ui.vertical(|ui| {
|
||||
ui.separator();
|
||||
if self.supported_interfaces.contains(&"Aura".to_string()) {
|
||||
// aura_power_group(states, ui);
|
||||
aura_power_group(states, ui);
|
||||
}
|
||||
});
|
||||
ui.end_row();
|
||||
|
||||
@@ -6,9 +6,10 @@ use std::time::SystemTime;
|
||||
use egui::Vec2;
|
||||
use log::error;
|
||||
use rog_anime::{Animations, DeviceState};
|
||||
use rog_aura::aura_detection::PowerZones;
|
||||
use rog_aura::layouts::KeyLayout;
|
||||
use rog_aura::usb::AuraPowerDev;
|
||||
use rog_aura::{AuraEffect, AuraModeNum, LedBrightness};
|
||||
use rog_aura::usb::{AuraDevice, AuraPowerDev};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
|
||||
use rog_platform::platform::{GpuMode, PlatformPolicy};
|
||||
use rog_profiles::fan_curve_set::CurveData;
|
||||
use rog_profiles::FanCurvePU;
|
||||
@@ -110,6 +111,9 @@ pub struct AuraState {
|
||||
pub current_mode: AuraModeNum,
|
||||
pub modes: BTreeMap<AuraModeNum, AuraEffect>,
|
||||
pub enabled: AuraPowerDev,
|
||||
pub dev_type: AuraDevice,
|
||||
pub supported_basic_zones: Vec<AuraZone>,
|
||||
pub supported_power_zones: Vec<PowerZones>,
|
||||
/// Brightness from 0-3
|
||||
pub bright: LedBrightness,
|
||||
pub wave_red: [u8; 22],
|
||||
@@ -132,6 +136,17 @@ impl AuraState {
|
||||
BTreeMap::new()
|
||||
},
|
||||
enabled: dbus.proxies().aura().led_power().unwrap_or_default(),
|
||||
supported_basic_zones: dbus
|
||||
.proxies()
|
||||
.aura()
|
||||
.supported_basic_zones()
|
||||
.unwrap_or_default(),
|
||||
supported_power_zones: dbus
|
||||
.proxies()
|
||||
.aura()
|
||||
.supported_power_zones()
|
||||
.unwrap_or_default(),
|
||||
dev_type: dbus.proxies().aura().device_type().unwrap_or_default(),
|
||||
bright: dbus.proxies().aura().brightness().unwrap_or_default(),
|
||||
wave_red: [0u8; 22],
|
||||
wave_green: [0u8; 22],
|
||||
|
||||
@@ -4,24 +4,23 @@ use rog_aura::usb::{AuraDevRog1, AuraDevTuf, AuraDevice, AuraPowerDev};
|
||||
|
||||
use crate::system_state::SystemState;
|
||||
|
||||
pub fn aura_power_group(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
|
||||
pub fn aura_power_group(states: &mut SystemState, ui: &mut Ui) {
|
||||
ui.heading("Keyboard LED power settings");
|
||||
|
||||
if supported.keyboard_led.dev_id.is_old_style() || supported.keyboard_led.dev_id.is_tuf_style()
|
||||
{
|
||||
aura_power1(supported, states, ui);
|
||||
} else if supported.keyboard_led.dev_id.is_new_style() {
|
||||
aura_power2(supported, states, ui);
|
||||
if states.aura.dev_type.is_old_style() || states.aura.dev_type.is_tuf_style() {
|
||||
aura_power1(states, ui);
|
||||
} else if states.aura.dev_type.is_new_style() {
|
||||
aura_power2(states, ui);
|
||||
}
|
||||
}
|
||||
|
||||
fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
|
||||
fn aura_power1(states: &mut SystemState, ui: &mut Ui) {
|
||||
let enabled_states = &mut states.aura.enabled;
|
||||
let mut boot = enabled_states.old_rog.contains(&AuraDevRog1::Boot);
|
||||
let mut sleep = enabled_states.old_rog.contains(&AuraDevRog1::Sleep);
|
||||
let mut keyboard = enabled_states.old_rog.contains(&AuraDevRog1::Keyboard);
|
||||
let mut lightbar = enabled_states.old_rog.contains(&AuraDevRog1::Lightbar);
|
||||
if supported.keyboard_led.dev_id == AuraDevice::Tuf {
|
||||
if states.aura.dev_type == AuraDevice::Tuf {
|
||||
boot = enabled_states.tuf.contains(&AuraDevTuf::Boot);
|
||||
sleep = enabled_states.tuf.contains(&AuraDevTuf::Sleep);
|
||||
keyboard = enabled_states.tuf.contains(&AuraDevTuf::Awake);
|
||||
@@ -58,7 +57,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
if ui.toggle_value(&mut keyboard, "Keyboard").changed() {
|
||||
changed = true;
|
||||
}
|
||||
if !supported.keyboard_led.basic_zones.is_empty()
|
||||
if !states.aura.supported_basic_zones.is_empty()
|
||||
&& ui.toggle_value(&mut lightbar, "Lightbar").changed()
|
||||
{
|
||||
changed = true;
|
||||
@@ -93,7 +92,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
});
|
||||
|
||||
if changed {
|
||||
if supported.keyboard_led.dev_id == AuraDevice::Tuf {
|
||||
if states.aura.dev_type == AuraDevice::Tuf {
|
||||
let mut enabled = Vec::new();
|
||||
let mut disabled = Vec::new();
|
||||
|
||||
@@ -132,7 +131,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
.asus_dbus
|
||||
.proxies()
|
||||
.aura()
|
||||
.set_led_power(options, enable)
|
||||
.set_led_power((options, enable))
|
||||
.map_err(|err| {
|
||||
states.error = Some(err.to_string());
|
||||
})
|
||||
@@ -168,7 +167,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
modify_x1866(boot, AuraDevRog1::Boot);
|
||||
modify_x1866(sleep, AuraDevRog1::Sleep);
|
||||
modify_x1866(keyboard, AuraDevRog1::Keyboard);
|
||||
if !supported.keyboard_led.basic_zones.is_empty() {
|
||||
if !states.aura.supported_basic_zones.is_empty() {
|
||||
modify_x1866(lightbar, AuraDevRog1::Lightbar);
|
||||
}
|
||||
|
||||
@@ -182,7 +181,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
.asus_dbus
|
||||
.proxies()
|
||||
.aura()
|
||||
.set_led_power(options, enable)
|
||||
.set_led_power((options, enable))
|
||||
.map_err(|err| {
|
||||
states.error = Some(err.to_string());
|
||||
})
|
||||
@@ -194,7 +193,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
}
|
||||
}
|
||||
|
||||
fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
|
||||
fn aura_power2(states: &mut SystemState, ui: &mut Ui) {
|
||||
let AuraPower {
|
||||
keyboard,
|
||||
logo,
|
||||
@@ -208,7 +207,7 @@ fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
let mut changed = false;
|
||||
let mut item = |power: &mut KbAuraPowerState, ui: &mut Ui| {
|
||||
ui.vertical(|ui| {
|
||||
if supported.keyboard_led.power_zones.contains(&power.zone) {
|
||||
if states.aura.supported_power_zones.contains(&power.zone) {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label(RichText::new(format!("{:?}", power.zone)).size(14.0));
|
||||
});
|
||||
@@ -247,7 +246,7 @@ fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
|
||||
.asus_dbus
|
||||
.proxies()
|
||||
.aura()
|
||||
.set_led_power(options, enable)
|
||||
.set_led_power((options, enable))
|
||||
.map_err(|err| {
|
||||
states.error = Some(err.to_string());
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
mod anime_power;
|
||||
mod app_settings;
|
||||
mod aura_modes;
|
||||
// mod aura_power;
|
||||
mod aura_power;
|
||||
mod fan_graph;
|
||||
mod keyboard_layout;
|
||||
mod rog_bios;
|
||||
@@ -11,7 +11,7 @@ mod top_bar;
|
||||
pub use anime_power::*;
|
||||
pub use app_settings::*;
|
||||
pub use aura_modes::*;
|
||||
// pub use aura_power::*;
|
||||
pub use aura_power::*;
|
||||
pub use fan_graph::*;
|
||||
pub use keyboard_layout::*;
|
||||
pub use rog_bios::*;
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use rog_aura::advanced::UsbPackets;
|
||||
use rog_aura::aura_detection::PowerZones;
|
||||
use rog_aura::usb::{AuraDevice, AuraPowerDev};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, LedBrightness};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
|
||||
use zbus::blocking::Connection;
|
||||
use zbus::{dbus_proxy, Result};
|
||||
|
||||
@@ -74,9 +75,17 @@ trait Aura {
|
||||
#[dbus_proxy(property)]
|
||||
fn supported_brightness(&self) -> zbus::Result<Vec<LedBrightness>>;
|
||||
|
||||
/// SupportedModes property
|
||||
/// SupportedBasicModes property
|
||||
#[dbus_proxy(property)]
|
||||
fn supported_modes(&self) -> zbus::Result<Vec<AuraModeNum>>;
|
||||
fn supported_basic_modes(&self) -> zbus::Result<Vec<AuraModeNum>>;
|
||||
|
||||
/// SupportedBasicZones property
|
||||
#[dbus_proxy(property)]
|
||||
fn supported_basic_zones(&self) -> zbus::Result<Vec<AuraZone>>;
|
||||
|
||||
/// SupportedPowerZones property
|
||||
#[dbus_proxy(property)]
|
||||
fn supported_power_zones(&self) -> zbus::Result<Vec<PowerZones>>;
|
||||
}
|
||||
|
||||
pub struct AuraProxyPerkey<'a>(AuraProxyBlocking<'a>);
|
||||
|
||||
Reference in New Issue
Block a user