device

package
v0.0.0-...-f524f21 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2015 License: BSD-2-Clause Imports: 2 Imported by: 0

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

func GetProperty(dev dbus.ObjectPath, p string) (v dbus.Variant, err error)

Get UPower device property

func Refresh

func Refresh() (err error)

func SignalChanged

func SignalChanged() (ch chan *dbus.Signal, err error)

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)

Jump to

Keyboard shortcuts

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