battery

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAttr

func GetAttr(ctx *types.Context, attr string, nth int) (any, error)

func GetAttrAsString

func GetAttrAsString(ctx *types.Context, attr string, round bool, nth int) (string, error)

Types

type Battery

type Battery struct {
	State            string  `json:"state"`
	BatteryNumber    int     `json:"battery-number"`
	Count            int     `json:"count"`
	ChargeRate       float64 `json:"charge-rate"`
	CurrentCapacity  float64 `json:"current-capacity"`
	CurrentCharge    float64 `json:"current-charge"`
	DesignCapacity   float64 `json:"design-capacity"`
	DesignVoltage    float64 `json:"design-voltage"`
	LastFullCapacity float64 `json:"last-full-capacity"`
	Voltage          float64 `json:"voltage"`
}

func Get

func Get(ctx *types.Context, nth int) (*Battery, error)

Jump to

Keyboard shortcuts

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