Files
asusctl/daemon/src/ctrl_profiles/config.rs
2023-01-06 19:47:42 +13:00

40 lines
853 B
Rust

use rog_profiles::{FanCurveProfiles, Profile};
use serde_derive::{Deserialize, Serialize};
use crate::config_traits::{StdConfig, StdConfigLoad1};
const CONFIG_FILE: &str = "profile.conf";
const CONFIG_FAN_FILE: &str = "fan_curves.conf";
#[derive(Deserialize, Serialize, Debug)]
pub struct ProfileConfig {
/// For restore on boot
pub active_profile: Profile,
}
impl StdConfig for ProfileConfig {
fn new() -> Self {
Self {
active_profile: Profile::Balanced,
}
}
fn file_name() -> &'static str {
CONFIG_FILE
}
}
impl StdConfigLoad1<ProfileConfig> for ProfileConfig {}
impl StdConfig for FanCurveProfiles {
fn new() -> Self {
Self::default()
}
fn file_name() -> &'static str {
CONFIG_FAN_FILE
}
}
impl StdConfigLoad1<ProfileConfig> for FanCurveProfiles {}