Only apply fan curve for profile if *on* that profile, but still save config

This commit is contained in:
Luke D. Jones
2024-03-14 21:28:06 +13:00
parent 1b4d7a95af
commit 5fe8416c65

View File

@@ -172,11 +172,14 @@ impl CtrlFanCurveZbus {
.await
.profiles
.save_fan_curve(curve, profile)?;
self.config
.lock()
.await
.profiles
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
let active: ThrottlePolicy = self.platform.get_throttle_thermal_policy()?.into();
if active == profile {
self.config
.lock()
.await
.profiles
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
}
self.config.lock().await.write();
Ok(())
}