mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-08 15:40:34 -04:00
power: Add interface for accessing platform-profiles
This commit is contained in:
parent
b26cc0f45c
commit
45edfe2c7c
10 changed files with 305 additions and 12 deletions
|
@ -34,6 +34,7 @@ pub(crate) struct PlatformConfig {
|
|||
pub tdp_limit: Option<RangeConfig<u32>>,
|
||||
pub gpu_clocks: Option<RangeConfig<u32>>,
|
||||
pub battery_charge_limit: Option<BatteryChargeLimitConfig>,
|
||||
pub performance_profile: Option<PerformanceProfileConfig>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Debug)]
|
||||
|
@ -113,6 +114,12 @@ pub(crate) struct BatteryChargeLimitConfig {
|
|||
pub attribute: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Debug)]
|
||||
pub(crate) struct PerformanceProfileConfig {
|
||||
pub suggested_default: String,
|
||||
pub platform_profile_name: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Deserialize, Debug)]
|
||||
pub(crate) struct FormatDeviceConfig {
|
||||
pub script: PathBuf,
|
||||
|
@ -139,6 +146,7 @@ impl PlatformConfig {
|
|||
async fn load() -> Result<Option<PlatformConfig>> {
|
||||
let platform = match device_type().await? {
|
||||
DeviceType::SteamDeck => "jupiter",
|
||||
DeviceType::LegionGoS => "legion-go-s",
|
||||
_ => return Ok(None),
|
||||
};
|
||||
let config = read_to_string(format!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue