Compare commits

...

10 Commits

Author SHA1 Message Date
Luke D. Jones 19370215c0 Cleanup 2022-07-24 20:55:09 +12:00
Luke D. Jones 030dd661b8 Switch zbus led_mode to return AuraModeNum 2022-07-24 20:45:20 +12:00
Luke D. Jones 1fc12d9855 Make CurveData members public 2022-07-24 10:50:28 +12:00
Luke D. Jones 6c1b2b70ea Make FanCurveSet members public 2022-07-24 10:47:40 +12:00
Luke D. Jones 23f9af35bf Add Hash derive to Profile 2022-07-24 09:43:22 +12:00
Luke D. Jones 526626b80c Minor tweaks on derives 2022-07-24 09:28:00 +12:00
Luke Jones 10eaaac54b Merge branch 'sova/G713IC-led-support' into 'main'
Add LED support for G713IC

See merge request asus-linux/asusctl!124
2022-07-21 12:39:43 +00:00
SoVa 901a3ddcc9 Add LED support for G713IC 2022-07-21 14:18:33 +02:00
Luke Jones e6ebf72a11 Merge branch 'main' into 'main'
Fix some typos.

See merge request asus-linux/asusctl!123
2022-07-21 07:59:16 +00:00
成超(Cheng Chao) a313359ef6 Fix some typos. 2022-07-21 12:46:44 +08:00
7 changed files with 18 additions and 25 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ where the number is a percentage.
Some options that you find in Armory Crate are available under this controller, so far there is:
- POST sound: this is the sound you here on bios boot post
- POST sound: this is the sound you hear on bios boot post
- G-Sync: this controls if the dGPU (Nvidia) is the *only* GPU, making it the main GPU and disabling the iGPU
These options are not written to the config file as they are stored in efivars. The only way to change these is to use the exposed safe dbus methods, or use the `asusctl` CLI tool.
@@ -293,7 +293,7 @@ A plain non-float integer.
## asusctl
`asusctl` is a commandline interface which intends to be the main method of interacting with `asusd`. I can be used in any place a terminal app can be used.
`asusctl` is a commandline interface which intends to be the main method of interacting with `asusd`. It can be used in any place a terminal app can be used.
This program will query `asusd` for the `Support` level of the laptop and show or hide options according to this support level.
+2 -2
View File
@@ -417,10 +417,10 @@ impl CtrlKbdLed {
let next = self.supported_modes.standard[idx];
self.config.read();
if self.config.builtins.contains_key(&next) {
// if self.config.builtins.contains_key(&next) {
self.config.current_mode = next;
self.write_current_config_mode()?;
}
// }
self.config.write();
}
+4 -10
View File
@@ -1,6 +1,6 @@
use async_trait::async_trait;
use log::warn;
use rog_aura::{usb::AuraPowerDev, AuraEffect, LedBrightness};
use rog_aura::{usb::AuraPowerDev, AuraEffect, LedBrightness, AuraModeNum};
use zbus::{dbus_interface, Connection, SignalContext};
use super::controller::CtrlKbdLedZbus;
@@ -175,17 +175,11 @@ impl CtrlKbdLedZbus {
}
/// Return the current mode data
#[dbus_interface(property)]
async fn led_mode(&self) -> String {
async fn led_mode(&self) -> AuraModeNum {
if let Ok(ctrl) = self.0.try_lock() {
if let Some(mode) = ctrl.config.builtins.get(&ctrl.config.current_mode) {
if let Ok(json) = serde_json::to_string(&mode) {
return json;
}
}
return ctrl.config.current_mode;
}
warn!("SetKeyBacklight could not deserialise");
"SetKeyBacklight could not deserialise".to_string()
AuraModeNum::Static
}
/// Return a list of available modes
+1 -1
View File
@@ -50,7 +50,7 @@ per_key = false
[[led_data]]
prod_family = "ROG Strix"
board_names = ["G531GW", "G533QR", "G533QS", "G733QS", "G733QR", "G513QR", "G713QR", "G513QM"]
board_names = ["G531GW", "G533QR", "G533QS", "G733QS", "G733QR", "G513QR", "G713QR", "G513QM", "G713IC"]
standard = ["Static", "Breathe", "Strobe", "Rainbow", "Star", "Rain", "Highlight", "Laser", "Ripple", "Pulse", "Comet", "Flash"]
multizone = []
per_key = true
+2 -3
View File
@@ -22,7 +22,7 @@
use zbus::{blocking::Connection, Result};
use zbus_macros::dbus_proxy;
use rog_aura::{usb::AuraPowerDev, AuraEffect, KeyColourArray, LedBrightness};
use rog_aura::{usb::AuraPowerDev, AuraEffect, KeyColourArray, LedBrightness, AuraModeNum};
const BLOCKING_TIME: u64 = 40; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS
@@ -63,8 +63,7 @@ trait Led {
fn led_brightness(&self) -> zbus::Result<i16>;
/// LedMode property
#[dbus_proxy(property)]
fn led_mode(&self) -> zbus::Result<String>;
fn led_mode(&self) -> zbus::Result<AuraModeNum>;
/// LedModes property
#[dbus_proxy(property)]
+6 -6
View File
@@ -29,9 +29,9 @@ pub(crate) fn temp_str(fan: char, index: usize) -> String {
#[cfg_attr(feature = "dbus", derive(Type))]
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
pub struct CurveData {
pub(crate) fan: FanCurvePU,
pub(crate) pwm: [u8; 8],
pub(crate) temp: [u8; 8],
pub fan: FanCurvePU,
pub pwm: [u8; 8],
pub temp: [u8; 8],
}
impl std::str::FromStr for CurveData {
@@ -166,9 +166,9 @@ impl CurveData {
#[cfg_attr(feature = "dbus", derive(Type))]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct FanCurveSet {
pub(crate) enabled: bool,
pub(crate) cpu: CurveData,
pub(crate) gpu: CurveData,
pub enabled: bool,
pub cpu: CurveData,
pub gpu: CurveData,
}
impl Default for FanCurveSet {
+1 -1
View File
@@ -38,7 +38,7 @@ pub fn find_fan_curve_node() -> Result<Option<Device>, ProfileError> {
}
#[cfg_attr(feature = "dbus", derive(Type))]
#[derive(Deserialize, Serialize, Debug, PartialEq, Clone, Copy)]
#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub enum Profile {
Balanced,
Performance,