mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-04-08 17:05:56 +02:00
added warnings to ideapad_laptop
This commit is contained in:
parent
0134da5e50
commit
02d81f06c4
@ -5,11 +5,12 @@ from auto_cpufreq.core import get_config
|
||||
|
||||
|
||||
def set_battery(value, mode, bat):
|
||||
try:
|
||||
path = f"/sys/class/power_supply/BAT{bat}/charge_{mode}_threshold"
|
||||
if os.path.exists(path):
|
||||
subprocess.check_output(
|
||||
f"echo {value} | tee /sys/class/power_supply/BAT{bat}/charge_{mode}_threshold", shell=True, text=True)
|
||||
except Exception as e:
|
||||
print(f"Error writing to file_path: {e}")
|
||||
else:
|
||||
print(f"WARNING: {path} does NOT exist")
|
||||
|
||||
|
||||
def get_threshold_value(mode):
|
||||
|
Loading…
x
Reference in New Issue
Block a user