1
Fork 0
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:
NotAShelf 2025-05-18 04:54:48 +03:00
parent eb9fbdc681
commit f1a5ad0b6c
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF

View file

@ -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;