bat

package
v0.0.0-...-bf74b40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2019 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

bat implemnts functions for parsing the files in /sys/class/power_supply/BAT0 It furthermore has some utility functions for doing percentage calculations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChargePercentage

func GetChargePercentage() (float64, error)

GetChargePercentage will get the current charge percentage - as a float64

func GetCurrentCharge

func GetCurrentCharge() (float64, error)

GetCurrentcharge will return the number given for current charge - as a float64

func GetFullCharge

func GetFullCharge() (float64, error)

GetFullCharge will return the number given for full charge - as a float64

func GetStatus

func GetStatus() (string, error)

GetStatus will read the status file. Possible returns are "Charging", "Discharging" and "Unknown" All file read errors are returned

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL