Documentation ¶
Overview ¶
Package powersupply tracks the power supply/usage on the host.
Index ¶
Constants ¶
View Source
const ( StateNamePowerSupply = "power_supply" StateKeyBatteryCapacity = "battery_capacity" StateKeyBatteryCapacityFound = "battery_capacity_found" )
View Source
const DefaultBatteryCapacityFile = "/sys/class/power_supply/BAT0/capacity"
View Source
const Name = "power-supply"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Query query_config.Config `json:"query"`
}
type Output ¶
type Output struct { BatteryCapacity uint64 `json:"battery_capacity"` BatteryCapacityFound bool `json:"battery_capacity_found"` }
func ParseOutputJSON ¶
func ParseStatesToOutput ¶
func ParseStatesToOutput(states ...components.State) (*Output, error)
Click to show internal directories.
Click to hide internal directories.