glbat

package
v0.0.0-...-c33b1db Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDetected

func GetDetected() ([]int, error)

Returns a list of detected battery ids.

Types

type Battery

type Battery struct {
	// battery id
	Id int

	// current battery capacity in percent
	Capacity         int
	CapacityLevel    string
	CycleCount       int
	EnergyFull       int
	EnergyFullDesign int
	EnergyNow        int
	Manufacturer     string
	ModelName        string
	PowerNow         int
	// whether the battery is present
	Present      bool
	SerialNumber string
	// battery status, e. g. "Charging"
	Status           string
	Technology       string
	VoltageNow       int
	VoltageMinDesign int
}

func GetAll

func GetAll() ([]Battery, error)

Get data for all batteries.

func GetBat

func GetBat(id int) (Battery, error)

Get data for battery with a certain id.

Jump to

Keyboard shortcuts

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