Fixed battery status not using same sensors as psutil

pull/151/head
aristocratos 2020-10-08 17:21:33 +02:00
parent 935c4e5d4d
commit 3e65c68e78
1 changed files with 1 additions and 1 deletions

View File

@ -1641,7 +1641,7 @@ class CpuBox(Box, SubBox):
if cls.battery_path == "": if cls.battery_path == "":
cls.battery_path = None cls.battery_path = None
if os.path.isdir("/sys/class/power_supply"): if os.path.isdir("/sys/class/power_supply"):
for directory in os.listdir("/sys/class/power_supply"): for directory in sorted(os.listdir("/sys/class/power_supply")):
if directory.startswith('BAT') or 'battery' in directory.lower(): if directory.startswith('BAT') or 'battery' in directory.lower():
cls.battery_path = f'/sys/class/power_supply/{directory}/' cls.battery_path = f'/sys/class/power_supply/{directory}/'
break break