power

package
v0.0.0-...-6ba15d7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadPowerInfo

func ReadPowerInfo(ctx context.Context, r execs.Runner) (*powerSupplyInfo, error)

ReadPowerInfo initialize and return a new powerSupplyInfo sturct. Output of power_supply_info shows two devices, Line Power and Battery, with details of each device listed. This function parses the output into a dictionary, with key being the device name, and value being a dictionary of details of the device info.

Device: Line Power
  online:                  no
  type:                    Mains
  voltage (V):             0
  current (A):             0
Device: Battery
  state:                   Discharging
  percentage:              95.9276
  technology:              Li-ion

Types

This section is empty.

Jump to

Keyboard shortcuts

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