diff --git a/razer_control_gui/src/cli.rs b/razer_control_gui/src/cli.rs index 9bb0cd1..df152dc 100644 --- a/razer_control_gui/src/cli.rs +++ b/razer_control_gui/src/cli.rs @@ -68,7 +68,7 @@ enum WriteAttr { struct PowerParams { /// battery/plugged in ac_state: AcState, - /// power mode (0, 1, 2 or 4) + /// power mode (0, 1, 2, 3 or 4) pwr: u8, /// cpu boost (0, 1, 2 or 3) cpu_mode: Option, @@ -569,6 +569,7 @@ fn read_power_mode(ac: usize) { 0 => "Balanced", 1 => "Gaming", 2 => "Creator", + 3 => "Silent", 4 => "Custom", _ => "Unknown", }; @@ -607,7 +608,7 @@ fn read_power_mode(ac: usize) { fn write_pwr_mode(ac: usize, pwr_mode: u8, cpu_mode: Option, gpu_mode: Option) { if pwr_mode > 4 { Cli::command() - .error(ErrorKind::InvalidValue, "Power mode must be 0, 1, 2 or 4") + .error(ErrorKind::InvalidValue, "Power mode must be 0, 1, 2, 3 or 4") .exit() } diff --git a/razer_control_gui/src/device.rs b/razer_control_gui/src/device.rs index f0170c8..4f18c02 100644 --- a/razer_control_gui/src/device.rs +++ b/razer_control_gui/src/device.rs @@ -767,11 +767,8 @@ impl RazerLaptop { return false; } - pub fn set_power_mode(&mut self, mut mode: u8, cpu_boost: u8, gpu_boost: u8) -> bool { - if mode <= 2 { - if mode == 2 && self.have_feature("creator_mode".to_string()) == false { - mode = 1; - } + pub fn set_power_mode(&mut self, mode: u8, cpu_boost: u8, gpu_boost: u8) -> bool { + if mode <= 3 { self.power = mode; self.set_power(0x01); self.set_power(0x02); @@ -981,4 +978,4 @@ fn bho_to_byte(is_on: bool, threshold: u8) -> u8 { return threshold | 0b1000_0000; } return threshold; -} \ No newline at end of file +}