mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
feature: rework PPT tuning handling more
1. Per profile, per-ac/dc 2. Do not apply unless group is enabled 3. Better reset/disable handling 4. Selecting a profile defaults PPT to off/disabled
This commit is contained in:
@@ -2,6 +2,7 @@ use std::fs::{read_dir, File, OpenOptions};
|
||||
use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use log::debug;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
@@ -75,6 +76,15 @@ impl Attribute {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn base_path_exists(&self) -> bool {
|
||||
let exists = self.base_path.exists();
|
||||
debug!(
|
||||
"Attribute path {:?} exits? {exists}",
|
||||
self.base_path.as_os_str()
|
||||
);
|
||||
exists
|
||||
}
|
||||
|
||||
/// Write the `current_value` directly to the attribute path
|
||||
pub fn set_current_value(&self, new_value: &AttrValue) -> Result<(), PlatformError> {
|
||||
let path = self.base_path.join("current_value");
|
||||
|
||||
Reference in New Issue
Block a user