profiles: add mid fan curve support

This commit is contained in:
Luke D. Jones
2023-07-21 22:07:04 +12:00
parent eb54250e4d
commit 51bcb0082b
16 changed files with 267 additions and 294 deletions

View File

@@ -660,7 +660,7 @@ fn handle_fan_curve(
supported: &PlatformProfileFunctions,
cmd: &FanCurveCommand,
) -> Result<(), Box<dyn std::error::Error>> {
if !supported.fan_curves {
if supported.fans.is_empty() {
println!("Fan-curves not supported by either this kernel or by the laptop.");
println!("This requires kernel 5.17 or the fan curve patch listed in the readme.");
return Err(ProfileError::NotSupported.into());
@@ -686,8 +686,9 @@ fn handle_fan_curve(
}
if cmd.get_enabled {
let res = dbus.proxies().profile().enabled_fan_profiles()?;
println!("{:?}", res);
// TODO:
// let res = dbus.proxies().profile().enabled_fan_profiles()?;
// println!("{:?}", res);
}
if cmd.default {

View File

@@ -34,12 +34,12 @@ pub struct FanCurveCommand {
pub mod_profile: Option<Profile>,
#[options(
meta = "",
help = "enable or disable <true/false> fan curve. `mod-profile` required"
help = "enable or disable <true/false> fan curve. `mod_profile` required"
)]
pub enabled: Option<bool>,
#[options(
meta = "",
help = "select fan <cpu/gpu> to modify. `mod-profile` required"
help = "select fan <cpu/gpu/mid> to modify. `mod_profile` required"
)]
pub fan: Option<FanCurvePU>,