acpi for some reason can return multiple batteries even though there is only one

This commit is contained in:
simon 2021-02-04 15:53:08 +07:00
parent 59455c5959
commit 6d337abc8e
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ LOG_FILE_PATH = "/tmp/battery_status.log"
def get_acpi():
""" get acpi data as a sting """
acpi_raw = subprocess.run(["acpi"], capture_output=True, check=False)
acpi_string = acpi_raw.stdout.decode().strip()
acpi_string = acpi_raw.stdout.decode().strip().split('\n')[0]
return acpi_string