diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e889e03..ace462fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed - Reintroduce persisting dark/light mode in config file - -### Changed - Added ability to change what EPP is linked with each throttle profile - Don't change EPP or thermal profile if the battery/ac state hasn't actually changed on resume - Re-implement the `asusctl -s` command (not fully) - Add more docs to some parts of code, and dbus interfaces - Reload asusd.ron if changed. Does not notify any dbus listeners (yet) - Fix the broken pipe error +- Remove the use of bytes in zbus signatures (another cause of broken pipe) ### Added - Support for G614J LED modes diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 83befc93..4d15b0e6 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -20,6 +20,7 @@ use rog_dbus::RogDbusClientBlocking; use rog_platform::error::PlatformError; use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy}; use rog_profiles::error::ProfileError; +use rog_profiles::fan_curve_set::CurveData; use crate::aura_cli::{AuraPowerStates, LedBrightness}; use crate::cli_opts::*; diff --git a/asusd/src/ctrl_fancurves.rs b/asusd/src/ctrl_fancurves.rs index c744ffc4..0dc19e0d 100644 --- a/asusd/src/ctrl_fancurves.rs +++ b/asusd/src/ctrl_fancurves.rs @@ -222,10 +222,7 @@ impl CtrlFanCurveZbus { /// Each platform_profile has a different default and the defualt can be /// read only for the currently active profile. async fn reset_profile_curves(&self, profile: ThrottlePolicy) -> zbus::fdo::Result<()> { - let active = self - .platform - .get_throttle_thermal_policy() - .unwrap_or(ThrottlePolicy::Balanced.into()); + let active = self.platform.get_throttle_thermal_policy()?; self.platform.set_throttle_thermal_policy(profile.into())?; self.fan_curves @@ -281,7 +278,6 @@ impl CtrlTask for CtrlFanCurveZbus { } } } - dbg!("STREAM ENDED"); } }); diff --git a/rog-aura/src/usb.rs b/rog-aura/src/usb.rs index 9f415de5..552418e4 100644 --- a/rog-aura/src/usb.rs +++ b/rog-aura/src/usb.rs @@ -137,7 +137,7 @@ pub struct AuraPowerDev { #[cfg_attr( feature = "dbus", derive(Type, Value, OwnedValue), - zvariant(signature = "y") + zvariant(signature = "u") )] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] @@ -172,7 +172,7 @@ impl AuraDevTuf { #[cfg_attr( feature = "dbus", derive(Type, Value, OwnedValue), - zvariant(signature = "y") + zvariant(signature = "u") )] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] diff --git a/rog-control-center/src/widgets/aura_modes.rs b/rog-control-center/src/widgets/aura_modes.rs index 380da31b..fe018bd7 100644 --- a/rog-control-center/src/widgets/aura_modes.rs +++ b/rog-control-center/src/widgets/aura_modes.rs @@ -230,7 +230,6 @@ pub fn aura_modes_group(states: &mut SystemState, freq: &mut Arc, ui: .aura() .set_led_mode_data(states.aura.modes.get(&selected).unwrap().clone()) .map_err(|err| { - dbg!(&err); states.error = Some(err.to_string()); }) .ok(); diff --git a/rog-control-center/src/widgets/aura_power.rs b/rog-control-center/src/widgets/aura_power.rs index 195ed553..a2374041 100644 --- a/rog-control-center/src/widgets/aura_power.rs +++ b/rog-control-center/src/widgets/aura_power.rs @@ -133,7 +133,6 @@ fn aura_power1(states: &mut SystemState, ui: &mut Ui) { .aura() .set_led_power((options, enable)) .map_err(|err| { - dbg!(&err); states.error = Some(err.to_string()); }) .ok(); @@ -184,7 +183,6 @@ fn aura_power1(states: &mut SystemState, ui: &mut Ui) { .aura() .set_led_power((options, enable)) .map_err(|err| { - dbg!(&err); states.error = Some(err.to_string()); }) .ok(); @@ -250,7 +248,6 @@ fn aura_power2(states: &mut SystemState, ui: &mut Ui) { .aura() .set_led_power((options, enable)) .map_err(|err| { - dbg!(&err); states.error = Some(err.to_string()); }) .ok(); diff --git a/rog-control-center/src/widgets/fan_graph.rs b/rog-control-center/src/widgets/fan_graph.rs index e78708f0..ccdbbf64 100644 --- a/rog-control-center/src/widgets/fan_graph.rs +++ b/rog-control-center/src/widgets/fan_graph.rs @@ -13,6 +13,10 @@ pub fn fan_graphs( do_error: &mut Option, ui: &mut Ui, ) { + if curves.available_fans.is_empty() { + return; // TODO: + } + ui.separator(); let mut item = |profile: ThrottlePolicy, ui: &mut Ui| { diff --git a/rog-dbus/src/zbus_fan_curves.rs b/rog-dbus/src/zbus_fan_curves.rs index b44689f2..0ca79e3a 100644 --- a/rog-dbus/src/zbus_fan_curves.rs +++ b/rog-dbus/src/zbus_fan_curves.rs @@ -39,7 +39,7 @@ trait FanCurves { /// /// Each platform_profile has a different default and the defualt can be /// read only for the currently active profile. - fn reset_profile_curves(&self, profile: ThrottlePolicy) -> zbus::fdo::Result<()>; + fn reset_profile_curves(&self, profile: ThrottlePolicy) -> zbus::Result<()>; /// SetActiveCurveToDefaults method fn set_active_curve_to_defaults(&self) -> zbus::Result<()>; diff --git a/rog-platform/src/cpu.rs b/rog-platform/src/cpu.rs index f703ca34..775f3f0e 100644 --- a/rog-platform/src/cpu.rs +++ b/rog-platform/src/cpu.rs @@ -180,7 +180,7 @@ impl From for String { } #[typeshare] -#[repr(u8)] +#[repr(u32)] #[derive( Deserialize, Serialize, @@ -194,7 +194,7 @@ impl From for String { Clone, Copy, )] -#[zvariant(signature = "y")] +#[zvariant(signature = "u")] pub enum CPUEPP { #[default] Default = 0, diff --git a/rog-platform/src/platform.rs b/rog-platform/src/platform.rs index 6640bf62..c7f4e98b 100644 --- a/rog-platform/src/platform.rs +++ b/rog-platform/src/platform.rs @@ -249,7 +249,7 @@ impl Display for GpuMode { } #[typeshare] -#[repr(u8)] +#[repr(u32)] #[derive( Deserialize, Serialize, @@ -266,7 +266,7 @@ impl Display for GpuMode { Clone, Copy, )] -#[zvariant(signature = "y")] +#[zvariant(signature = "u")] /// `throttle_thermal_policy` in asus_wmi pub enum ThrottlePolicy { #[default] diff --git a/rog-profiles/src/lib.rs b/rog-profiles/src/lib.rs index 77345421..272f40a1 100644 --- a/rog-profiles/src/lib.rs +++ b/rog-profiles/src/lib.rs @@ -10,6 +10,7 @@ use typeshare::typeshare; pub use udev::Device; #[cfg(feature = "dbus")] use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Value}; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -31,12 +32,16 @@ pub fn find_fan_curve_node() -> Result { } #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Deserialize, Serialize, Debug, Hash, PartialEq, Eq, Clone, Copy)] pub enum FanCurvePU { - CPU, - GPU, - MID, + CPU = 0, + GPU = 1, + MID = 2, } impl FanCurvePU {