mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
power: rc4, remove energy_full_design check
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -552,7 +552,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
|
||||
|
||||
[[package]]
|
||||
name = "daemon"
|
||||
version = "4.4.0-rc3"
|
||||
version = "4.4.0-rc4"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"env_logger",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "daemon"
|
||||
version = "4.4.0-rc3"
|
||||
version = "4.4.0-rc4"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
authors = ["Luke <luke@ljones.dev>"]
|
||||
|
||||
@@ -6,7 +6,7 @@ use rog_control_center::{
|
||||
};
|
||||
|
||||
use std::{
|
||||
fs::{self, OpenOptions},
|
||||
fs::OpenOptions,
|
||||
io::{Read, Write},
|
||||
path::PathBuf,
|
||||
sync::{atomic::AtomicBool, Arc},
|
||||
|
||||
@@ -70,15 +70,9 @@ impl AsusPower {
|
||||
.attribute_value("charge_control_end_threshold")
|
||||
.is_some()
|
||||
{
|
||||
if let Some(m) = device.attribute_value("energy_full_design") {
|
||||
if let Ok(num) = m.to_string_lossy().parse::<u32>() {
|
||||
if num >= 50_000_000 {
|
||||
info!("Found battery power at {:?}, matched charge_control_end_threshold and energy_full_design", device.sysname());
|
||||
battery = Some(device.syspath().to_path_buf());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if device.sysname().to_string_lossy().contains("BAT") {
|
||||
info!("Found battery power at {:?}, matched charge_control_end_threshold and energy_full_design", device.sysname());
|
||||
battery = Some(device.syspath().to_path_buf());
|
||||
} else if device.sysname().to_string_lossy().starts_with("BAT") {
|
||||
info!(
|
||||
"Found battery power at {:?}, sysfs path ended with BAT<n>",
|
||||
device.sysname()
|
||||
|
||||
Reference in New Issue
Block a user