Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Revert "fix: always read power mode from controller"
Browse files Browse the repository at this point in the history
This reverts commit a66982d.
  • Loading branch information
phush0 committed Apr 29, 2024
1 parent 03ca967 commit ed41987
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions razer_control_gui/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ impl DeviceManager {
}
if let Some(laptop) = self.get_device() {
let state = laptop.get_ac_state();
if state != ac && pwr != 0 && pwr != 3 {
eprintln!("Unsupported mode");
if state != ac {
res = true;
} else {
res = laptop.set_power_mode(pwr, cpu, gpu);
Expand Down Expand Up @@ -412,7 +411,13 @@ impl DeviceManager {

pub fn get_power_mode(&mut self, _ac:usize) -> u8 {
if let Some(laptop) = self.get_device() {
return laptop.get_power_mode(0x01);
if laptop.ac_state as usize == ac {
return laptop.get_power_mode(0x01);
}
}

if let Some(config) = self.get_ac_config(ac) {
return config.power_mode;
}

return 0;
Expand Down

0 comments on commit ed41987

Please sign in to comment.