1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

fix for never fully discharging state

This commit is contained in:
Kelly Brazil
2023-01-22 08:57:50 -08:00
parent 2a148d44a1
commit dbfe682674

View File

@ -227,7 +227,7 @@ import jc.utils
class info(): class info():
"""Provides parser metadata (version, author, etc.)""" """Provides parser metadata (version, author, etc.)"""
version = '1.4' version = '1.5'
description = '`acpi` command parser' description = '`acpi` command parser'
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
@ -336,7 +336,9 @@ def parse(data, raw=False, quiet=False):
if 'Charging' in line or 'Discharging' in line or 'Full' in line: if 'Charging' in line or 'Discharging' in line or 'Full' in line:
output_line['state'] = line.split()[2][:-1] output_line['state'] = line.split()[2][:-1]
output_line['charge_percent'] = line.split()[3].rstrip('%,') output_line['charge_percent'] = line.split()[3].rstrip('%,')
if 'rate information unavailable' not in line: if 'will never fully discharge' in line:
pass
elif 'rate information unavailable' not in line:
if 'Charging' in line: if 'Charging' in line:
output_line['until_charged'] = line.split()[4] output_line['until_charged'] = line.split()[4]
if 'Discharging' in line: if 'Discharging' in line: