1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 08:57:46 +00:00

config: make ProfileConfig serialisable

This commit is contained in:
NotAShelf 2025-05-15 22:58:47 +03:00
parent b11bad74d5
commit 90fd077a67
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF

View file

@ -37,7 +37,7 @@ impl TryFrom<(u8, u8)> for BatteryChargeThresholds {
}
// Structs for configuration using serde::Deserialize
#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ProfileConfig {
pub governor: Option<String>,
pub turbo: Option<TurboSetting>,
@ -67,7 +67,7 @@ impl Default for ProfileConfig {
}
}
#[derive(Deserialize, Debug, Default, Clone)]
#[derive(Deserialize, Serialize, Debug, Default, Clone)]
pub struct AppConfig {
#[serde(default)]
pub charger: ProfileConfig,
@ -212,7 +212,7 @@ impl From<ProfileConfigToml> for ProfileConfig {
}
}
#[derive(Deserialize, Debug, Clone)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct DaemonConfig {
#[serde(default = "default_poll_interval_sec")]
pub poll_interval_sec: u64,
@ -261,7 +261,7 @@ const fn default_adaptive_interval() -> bool {
}
const fn default_min_poll_interval_sec() -> u64 {
1
1
}
const fn default_max_poll_interval_sec() -> u64 {