Fetch and store fan curve correctly

This commit is contained in:
Luke D. Jones
2021-09-09 23:45:18 +12:00
parent 0a565a7a5c
commit b939a9d331
12 changed files with 114 additions and 73 deletions

View File

@@ -21,7 +21,7 @@
use std::sync::mpsc::Sender;
use rog_profiles::{Profile, fan_curves::FanCurveSet};
use rog_profiles::{fan_curve_set::FanCurveSet, Profile};
use zbus::{dbus_proxy, Connection, Result};
#[dbus_proxy(
@@ -29,27 +29,27 @@ use zbus::{dbus_proxy, Connection, Result};
default_path = "/org/asuslinux/Profile"
)]
trait Daemon {
/// Profiles method
fn profiles(&self) -> zbus::Result<Vec<Profile>>;
/// NextProfile method
fn next_profile(&self) -> zbus::Result<()>;
/// Get the active `Profile` data
fn active_fan_curve_data(&self) -> zbus::Result<FanCurveSet>;
/// Profile, get the active profile
fn active_profile(&self) -> zbus::Result<Profile>;
/// Set the specific profile as active
fn set_active_profile(&self, profile: Profile) -> zbus::Result<()>;
/// Get enabled fan curves
fn enabled_fan_profiles(&self) -> zbus::Result<Vec<Profile>>;
/// Get the active `Profile` data
fn active_fan_data(&self) -> zbus::Result<FanCurveSet>;
/// Get all fan curve data
fn fan_curves(&self) -> zbus::Result<Vec<FanCurveSet>>;
/// NextProfile method
fn next_profile(&self) -> zbus::Result<()>;
/// Profiles method
fn profiles(&self) -> zbus::Result<Vec<Profile>>;
/// Set the specific profile as active
fn set_active_profile(&self, profile: Profile) -> zbus::Result<()>;
/// Set a fan curve. If a field is empty then the exisiting saved curve is used
fn set_fan_curve(&self, curve: FanCurveSet) -> zbus::Result<()>;