Documentation ¶
Index ¶
Constants ¶
View Source
const ( LinePower = 1 Battery = 2 UPS = 3 Monitor = 4 Mouse = 5 Keyboard = 6 PDA = 7 Phone = 8 )
Possible power sources
View Source
const ( Charging = 1 Discharging = 2 Empty = 3 FullyCharged = 4 PendingCharge = 5 PendingDischarge = 6 )
Possible states
View Source
const ( LithiumIon = 1 LithiumPolymer = 2 LithiumIronPhosphate = 3 LeadAcid = 4 NickelCadmium = 5 NickelMetalHydride = 6 )
Possible technologys
View Source
const ( NativePath = "NativePath" Vendor = "Vendor" Model = "Model" Serial = "Serial" UpdateTime = "UpdateTime" Type = "Type" PowerSupply = "PowerSupply" HasHistory = "HasHistory" HasStatistics = "HasStatistics" Online = "Online" Energy = "Energy" EnergyEmpty = "EnergyEmpty" EnergyFull = "EnergyFull" EnergyFullDesign = "EnergyFullDesign" EnergyRate = "EnergyRate" Voltage = "Voltage" TimeToEmpty = "TimeToEmpty" TimeToFull = "TimeToFull" Percentage = "Percentage" IsPresent = "IsPresent" State = "State" IsRechargeable = "IsRechargeable" Capacity = "Capacity" Technology = "Technology" RecallNotice = "RecallNotice" RecallVendor = "RecallVendor" RecallUrl = "RecallUrl" )
Properties
View Source
const Unknown = 0
Value shared by multiple properties
Variables ¶
This section is empty.
Functions ¶
func GetProperty ¶
Get UPower device property
func SignalChanged ¶
Some value on the power source changed.
Types ¶
type Properties ¶
type Properties struct { NativePath string Vendor string Model string Serial string UpdateTime uint64 Type uint32 PowerSupply bool HasHistory bool HasStatistics bool Online bool Energy float64 EnergyEmpty float64 EnergyFull float64 EnergyFullDesign float64 EnergyRate float64 Voltage float64 TimeToEmpty time.Duration TimeToFull time.Duration Percentage float64 IsPresent bool State uint32 IsRechargeable bool Capacity float64 Technology uint32 RecallNotice bool RecallVendor string RecallUrl string }
func GetAllProperties ¶
func GetAllProperties(dev dbus.ObjectPath) (p *Properties, err error)
Click to show internal directories.
Click to hide internal directories.