enable_tresholds config file improvements (Closes: #641)

This commit is contained in:
PurpleWazard 2024-02-10 11:02:25 -06:00 committed by GitHub
parent 3e8ee20117
commit 005b4aa178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 12 deletions

View File

@ -35,7 +35,8 @@ def battery_stop_threshold():
def battery_setup():
root_check()
conf = get_config()
if conf.has_option("battery", "enable_thresholds") and conf["battery"]["enable_thresholds"] == "true":
if conf.has_option("battery", "enable_thresholds"):
if conf["battery"]["enable_thresholds"] == "true":
if lsmod("thinkpad_acpi"):
thinkpad_setup(battery_start_threshold(), battery_stop_threshold())
elif lsmod("ideapad_acpi"):
@ -44,10 +45,13 @@ def battery_setup():
pass
else:
pass
else:
pass
def battery_get_thresholds():
conf = get_config()
if conf.has_option("battery", "enable_thresholds"):
if conf["battery"]["enable_thresholds"] == "true":
print("-" * 30 )
if lsmod("thinkpad_acpi"):
@ -58,3 +62,5 @@ def battery_get_thresholds():
pass
else:
return
else:
return