mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Advanced Aura feature
Groundwork for 'advanced' aura modes Add single zone + Doom light flash Fix mocking for ROGCC Better prepare & change to mapping of keyboard layouts to models and functions Refactor and begin using new key layout stuff Enable first arg to rogcc to set layout in mocking feature mode Complete refactor of key layouts, and to RON serde
This commit is contained in:
@@ -1,35 +1,48 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use rog_aura::{
|
||||
usb::{AuraDev19b6, AuraDevice, AuraPowerDev},
|
||||
AuraEffect, AuraModeNum, AuraZone,
|
||||
};
|
||||
use rog_profiles::fan_curve_set::{CurveData, FanCurveSet};
|
||||
use rog_supported::{
|
||||
AnimeSupportedFunctions, ChargeSupportedFunctions, LedSupportedFunctions,
|
||||
use rog_aura::usb::{AuraDev19b6, AuraDevice, AuraPowerDev};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone};
|
||||
use rog_platform::platform::GpuMode;
|
||||
use rog_platform::supported::{
|
||||
AdvancedAura, AnimeSupportedFunctions, ChargeSupportedFunctions, LedSupportedFunctions,
|
||||
PlatformProfileFunctions, RogBiosSupportedFunctions, SupportedFunctions,
|
||||
};
|
||||
use rog_profiles::fan_curve_set::{CurveData, FanCurveSet};
|
||||
use supergfxctl::pci_device::{GfxMode, GfxPower};
|
||||
|
||||
use crate::error::Result;
|
||||
|
||||
const NOPE: &'static str = "";
|
||||
const NOPE: &str = "";
|
||||
|
||||
pub struct RogDbusClientBlocking<'a> {
|
||||
#[derive(Default)]
|
||||
pub struct DaemonProxyBlocking<'a> {
|
||||
_phantom: &'a str,
|
||||
}
|
||||
|
||||
impl<'a> Default for RogDbusClientBlocking<'a> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
_phantom: Default::default(),
|
||||
}
|
||||
impl<'a> DaemonProxyBlocking<'a> {
|
||||
pub fn new(_c: &bool) -> Result<Self> {
|
||||
Ok(Self { _phantom: NOPE })
|
||||
}
|
||||
|
||||
pub fn mode(&self) -> Result<GfxMode> {
|
||||
Ok(GfxMode::None)
|
||||
}
|
||||
|
||||
pub fn power(&self) -> Result<GfxPower> {
|
||||
Ok(GfxPower::Suspended)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RogDbusClientBlocking<'a> {
|
||||
_phantom: &'a str,
|
||||
}
|
||||
|
||||
impl<'a> RogDbusClientBlocking<'a> {
|
||||
pub fn new() -> Result<(Self, bool)> {
|
||||
Ok((Self { _phantom: NOPE }, true))
|
||||
}
|
||||
|
||||
pub fn proxies(&self) -> Proxies {
|
||||
Proxies
|
||||
}
|
||||
@@ -40,18 +53,23 @@ impl Proxies {
|
||||
pub fn rog_bios(&self) -> Bios {
|
||||
Bios
|
||||
}
|
||||
|
||||
pub fn profile(&self) -> Profile {
|
||||
Profile
|
||||
}
|
||||
|
||||
pub fn led(&self) -> Led {
|
||||
Led
|
||||
}
|
||||
|
||||
pub fn anime(&self) -> Anime {
|
||||
Anime
|
||||
}
|
||||
|
||||
pub fn charge(&self) -> Profile {
|
||||
Profile
|
||||
}
|
||||
|
||||
pub fn supported(&self) -> Supported {
|
||||
Supported
|
||||
}
|
||||
@@ -62,18 +80,23 @@ impl Bios {
|
||||
pub fn post_boot_sound(&self) -> Result<i16> {
|
||||
Ok(1)
|
||||
}
|
||||
pub fn gpu_mux_mode(&self) -> Result<i16> {
|
||||
Ok(1)
|
||||
|
||||
pub fn gpu_mux_mode(&self) -> Result<GpuMode> {
|
||||
Ok(GpuMode::Optimus)
|
||||
}
|
||||
pub fn panel_od(&self) -> Result<i16> {
|
||||
Ok(1)
|
||||
|
||||
pub fn panel_od(&self) -> Result<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
pub fn set_post_boot_sound(&self, _b: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
pub fn set_gpu_mux_mode(&self, _b: bool) -> Result<()> {
|
||||
|
||||
pub fn set_gpu_mux_mode(&self, _b: GpuMode) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_panel_od(&self, _b: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
@@ -88,15 +111,18 @@ impl Profile {
|
||||
rog_profiles::Profile::Quiet,
|
||||
])
|
||||
}
|
||||
|
||||
pub fn active_profile(&self) -> Result<rog_profiles::Profile> {
|
||||
Ok(rog_profiles::Profile::Performance)
|
||||
}
|
||||
|
||||
pub fn enabled_fan_profiles(&self) -> Result<Vec<rog_profiles::Profile>> {
|
||||
Ok(vec![
|
||||
rog_profiles::Profile::Performance,
|
||||
rog_profiles::Profile::Balanced,
|
||||
])
|
||||
}
|
||||
|
||||
pub fn fan_curve_data(&self, _p: rog_profiles::Profile) -> Result<FanCurveSet> {
|
||||
let mut curve = FanCurveSet::default();
|
||||
curve.cpu.pwm = [30, 40, 60, 100, 140, 180, 200, 250];
|
||||
@@ -105,21 +131,34 @@ impl Profile {
|
||||
curve.gpu.temp = [20, 30, 40, 50, 70, 80, 90, 100];
|
||||
Ok(curve)
|
||||
}
|
||||
|
||||
pub fn set_fan_curve(&self, _p: rog_profiles::Profile, _c: CurveData) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_fan_curve_enabled(&self, _p: rog_profiles::Profile, _b: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
pub fn limit(&self) -> Result<i16> {
|
||||
|
||||
pub fn charge_control_end_threshold(&self) -> Result<u8> {
|
||||
Ok(66)
|
||||
}
|
||||
pub fn set_limit(&self, _l: u8) -> Result<()> {
|
||||
|
||||
pub fn set_charge_control_end_threshold(&self, _l: u8) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_active_profile(&self, _p: rog_profiles::Profile) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn mains_online(&self) -> Result<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
pub fn reset_profile_curves(&self, _p: rog_profiles::Profile) -> Result<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Led;
|
||||
@@ -139,12 +178,15 @@ impl Led {
|
||||
data.insert(AuraModeNum::Pulse, AuraEffect::default());
|
||||
Ok(data)
|
||||
}
|
||||
|
||||
pub fn led_mode(&self) -> Result<AuraModeNum> {
|
||||
Ok(AuraModeNum::Rainbow)
|
||||
}
|
||||
|
||||
pub fn led_brightness(&self) -> Result<i16> {
|
||||
Ok(1)
|
||||
}
|
||||
|
||||
pub fn leds_enabled(&self) -> Result<AuraPowerDev> {
|
||||
Ok(AuraPowerDev {
|
||||
tuf: vec![],
|
||||
@@ -157,9 +199,11 @@ impl Led {
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
pub fn set_leds_power(&self, _a: AuraPowerDev, _b: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_led_mode(&self, _a: &AuraEffect) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
@@ -170,12 +214,15 @@ impl Anime {
|
||||
pub fn boot_enabled(&self) -> Result<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
pub fn awake_enabled(&self) -> Result<bool> {
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
pub fn set_on_off(&self, _b: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_boot_on_off(&self, _b: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
@@ -194,16 +241,16 @@ impl Supported {
|
||||
fan_curves: true,
|
||||
},
|
||||
keyboard_led: LedSupportedFunctions {
|
||||
prod_id: AuraDevice::X19B6,
|
||||
brightness_set: true,
|
||||
stock_led_modes: vec![
|
||||
dev_id: AuraDevice::X19B6,
|
||||
brightness: true,
|
||||
basic_modes: vec![
|
||||
AuraModeNum::Rain,
|
||||
AuraModeNum::Rainbow,
|
||||
AuraModeNum::Star,
|
||||
AuraModeNum::Static,
|
||||
AuraModeNum::Strobe,
|
||||
],
|
||||
multizone_led_mode: vec![
|
||||
basic_zones: vec![
|
||||
AuraZone::Key1,
|
||||
AuraZone::Key2,
|
||||
AuraZone::Key3,
|
||||
@@ -212,12 +259,12 @@ impl Supported {
|
||||
AuraZone::BarRight,
|
||||
AuraZone::Logo,
|
||||
],
|
||||
per_key_led_mode: true,
|
||||
advanced_type: AdvancedAura::PerKey,
|
||||
},
|
||||
rog_bios_ctrl: RogBiosSupportedFunctions {
|
||||
post_sound: true,
|
||||
dedicated_gfx: true,
|
||||
panel_od: true,
|
||||
gpu_mux: true,
|
||||
panel_overdrive: true,
|
||||
dgpu_disable: true,
|
||||
egpu_enable: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user