WTY-BatInfo WTY-BatInfo
WTY-BatInfo
WTY-BatInfo Printable version
Font Size   WTY-BatInfo  WTY-BatInfo

Wty-batinfo

# Capacity design = read_file(f"BAT_PATH/energy_full_design") full = read_file(f"BAT_PATH/energy_full") now = read_file(f"BAT_PATH/energy_now") if design and full: info['design_capacity_mWh'] = int(design) info['full_capacity_mWh'] = int(full) info['wear_level_percent'] = round((1 - int(full)/int(design)) * 100, 1) if now and full: info['charge_percent'] = round(int(now) / int(full) * 100, 1)

BAT_PATH = "/sys/class/power_supply/BAT0" WTY-BatInfo

# Cycle count info['cycle_count'] = read_file(f"BAT_PATH/cycle_count") WTY-BatInfo

copyright © 2020 the divine life society. All rights reserved.