Correcting charge status in multi-battery setup (#294)

This commit is contained in:
Jason Honea 2021-11-27 23:33:40 -06:00 committed by GitHub
parent 71db47157a
commit 01b7c0fe2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ def charging():
# Battery statuses: Full, Charging, Discharging, Unknown
battery_status = getoutput(f"grep . {power_dir}B*/status").splitlines()
# if there's one battery charging, or if there's one ac-adapter on-line, ac_state is True
ac_state = (any([not "Discharging" in ac for ac in battery_status]) or
ac_state = (all([not "Discharging" in ac for ac in battery_status]) or
any(["1" in ac.split(":")[-1] for ac in ac_info]))
else:
has_battery = psutil.sensors_battery() is not None