Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Battery ¶
type Battery struct { Path string Name string `json:"name"` Status string `json:"status"` Present bool `json:"present"` Technology string `json:"technology"` Model Model `json:"model"` CycleCount int64 `json:"cycle_count"` Voltage Voltage `json:"voltage"` CurrentNow int64 `json:"current_now"` Charge Charge `json:"charge"` Capacity Capacity `json:"capacity"` }
Battery is the struct for a battery
func (*Battery) IsCharging ¶
IsCharging is a pretty redundant function, but I'll be using it
func (*Battery) PercentCharge ¶
PercentCharge calculates the remaining power
func (*Battery) TimeLeftUntilFull ¶
TimeLeftUntilFull calculates the time left until full charge
type Charge ¶
type Charge struct { FullDesign int64 `json:"full_design"` Full int64 `json:"full"` Now int64 `json:"now"` }
Charge is the battery charge
type Model ¶
type Model struct { Name string `json:"name"` Manufacturer string `json:"manufacturer"` Serial int64 `json:"serial"` }
Model is the battery model
type PowerSupplies ¶
PowerSupplies is the struct for batteries and AC
func GetDevices ¶
func GetDevices() (*PowerSupplies, error)
GetDevices returns an array of backlight devices (intel_backlight, acpi_backlight, etc)
func (*PowerSupplies) PopulateAll ¶
func (devices *PowerSupplies) PopulateAll() error
PopulateAll updates everything in PowerSupplies
Click to show internal directories.
Click to hide internal directories.