battery

package
v0.0.0-...-d1fb4aa Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: GPL-3.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusMap = map[string]Status{
	"Unknown":      StatusUnknown,
	"Charging":     StatusCharging,
	"Discharging":  StatusDischarging,
	"Not charging": StatusNotCharging,
	"Full":         StatusFull,
	"FullCharging": StatusFullCharging,
}

Functions

This section is empty.

Types

type BatteryInfo

type BatteryInfo struct {
	Manufacturer string
	ModelName    string
	SerialNumber string
	Name         string
	Technology   string

	Energy           float64
	EnergyFull       float64
	EnergyFullDesign float64
	EnergyRate       float64

	Voltage     float64
	Percentage  float64
	Capacity    float64
	Status      Status
	TimeToEmpty uint64
	TimeToFull  uint64
}

func GetBatteryInfo

func GetBatteryInfo(bat *gudev.Device) *BatteryInfo

type Status

type Status uint32
const (
	StatusUnknown Status = iota
	StatusCharging
	StatusDischarging
	StatusNotCharging
	StatusFull
	StatusFullCharging
)

/include/linux/power_supply.h

func GetDisplayStatus

func GetDisplayStatus(slice []Status) Status

func (Status) String

func (state Status) String() string

Jump to

Keyboard shortcuts

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