battery

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battery

type Battery struct {
	// BatteryCellDisconnectCount is the number of times the battery cells have
	// been disconnected.
	BatteryCellDisconnectCount int

	// BuiltIn indicates if the battery is built-in or not.
	BuiltIn bool

	// ChargeRateAmps is the current charge rate in mAh. Negative values
	// indicate discharge, positive values indicate charging.
	ChargeRateAmps int64

	// ChargeRateWatts is the current charge rate in mWh. Negative values
	// indicate discharge, positive values indicate charging.
	ChargeRateWatts float64

	// CurrentCapacityAmps is the current battery capacity in mAh.
	CurrentCapacityAmps int

	// CurrentCapacityWatts is the current battery capacity in mWh.
	CurrentCapacityWatts float64

	// CurrentPercentage is the current battery capacity as a percentage.
	CurrentPercentage int

	// CycleCount is the current cycle count.
	CycleCount int

	// DesignCapacityAmps is the design capacity in mAh.
	DesignCapacityAmps int

	// DesignCapacityWatts is the design capacity in mWh.
	DesignCapacityWatts float64

	// DeviceName is the battery device name.
	DeviceName string

	// FullyCharged indicates if the battery is fully charged.
	FullyCharged bool

	// Health is the battery health as a percentage (0-100%).
	Health int

	// IsCharging indicates if the battery is currently charging.
	IsCharging bool

	// MaxCapacityAmps is the maximum capacity in mAh.
	MaxCapacityAmps int

	// MaxCapacityWatts is the maximum capacity in mWh.
	MaxCapacityWatts float64

	// Serial is the battery serial number.
	Serial string

	// Temperature is the current temperature in °C.
	Temperature float64

	// TimeRemaining is the estimated time remaining until the battery is
	// fully charged or discharged.
	TimeRemaining time.Duration

	// Voltage is the current voltage in mV.
	Voltage int64
}

func Get

func Get() (*Battery, error)

func GetAll

func GetAll() ([]*Battery, error)

Jump to

Keyboard shortcuts

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