mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
MOrE
This commit is contained in:
@@ -239,6 +239,25 @@ impl From<CPUEPP> for String {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<i32> for CPUEPP {
|
||||
fn from(value: i32) -> Self {
|
||||
match value {
|
||||
0 => Self::Default,
|
||||
1 => Self::Performance,
|
||||
2 => Self::BalancePerformance,
|
||||
3 => Self::BalancePower,
|
||||
4 => Self::Power,
|
||||
_ => Self::Default,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CPUEPP> for i32 {
|
||||
fn from(value: CPUEPP) -> Self {
|
||||
value as i32
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::CPUControl;
|
||||
|
||||
@@ -29,12 +29,12 @@ impl RogPlatform {
|
||||
|
||||
attr_bool!("egpu_enable", path);
|
||||
|
||||
attr_u8!("gpu_mux_mode", path);
|
||||
|
||||
attr_bool!("panel_od", path);
|
||||
|
||||
attr_bool!("mini_led_mode", path);
|
||||
|
||||
attr_u8!("gpu_mux_mode", path);
|
||||
|
||||
attr_u8!(
|
||||
/// This is technically the same as `platform_profile` since both are
|
||||
/// tied in-kernel
|
||||
@@ -303,6 +303,12 @@ impl From<u8> for ThrottlePolicy {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<i32> for ThrottlePolicy {
|
||||
fn from(num: i32) -> Self {
|
||||
(num as u8).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ThrottlePolicy> for u8 {
|
||||
fn from(p: ThrottlePolicy) -> Self {
|
||||
match p {
|
||||
@@ -313,6 +319,12 @@ impl From<ThrottlePolicy> for u8 {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ThrottlePolicy> for i32 {
|
||||
fn from(p: ThrottlePolicy) -> Self {
|
||||
<u8>::from(p) as i32
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ThrottlePolicy> for &str {
|
||||
fn from(profile: ThrottlePolicy) -> &'static str {
|
||||
match profile {
|
||||
|
||||
Reference in New Issue
Block a user