mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-27 17:07:44 +00:00
engine: improve AC state detection
I hate the number of possible hardware combinations...
This commit is contained in:
parent
eb9fbdc681
commit
f1a5ad0b6c
1 changed files with 3 additions and 3 deletions
|
@ -168,13 +168,13 @@ pub fn determine_and_apply_settings(
|
||||||
|
|
||||||
// Determine AC/Battery status once, early in the function
|
// Determine AC/Battery status once, early in the function
|
||||||
// For desktops (no batteries), we should always use the AC power profile
|
// For desktops (no batteries), we should always use the AC power profile
|
||||||
// For laptops, we check if any battery is present and not connected to AC
|
// For laptops, we check if all batteries report connected to AC
|
||||||
let on_ac_power = if report.batteries.is_empty() {
|
let on_ac_power = if report.batteries.is_empty() {
|
||||||
// No batteries means desktop/server, always on AC
|
// No batteries means desktop/server, always on AC
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
// Check if any battery reports AC connected
|
// Check if all batteries report AC connected
|
||||||
report.batteries.iter().any(|b| b.ac_connected)
|
report.batteries.iter().all(|b| b.ac_connected)
|
||||||
};
|
};
|
||||||
|
|
||||||
let selected_profile_config: &ProfileConfig;
|
let selected_profile_config: &ProfileConfig;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue