Documentation ¶
Index ¶
- type Battery
- type ManagedDevice
- func (manDev *ManagedDevice) Add(chunk string)
- func (manDev *ManagedDevice) BatteryPercent() int64
- func (manDev *ManagedDevice) BluetoothDevice() bool
- func (manDev *ManagedDevice) BuiltIn() bool
- func (manDev *ManagedDevice) Dump() string
- func (manDev *ManagedDevice) HasBattery() bool
- func (manDev *ManagedDevice) Product() string
- type ManagedDevices
- type Settings
- type Widget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Battery ¶
func NewBattery ¶
func NewBattery() *Battery
type ManagedDevice ¶
ManagedDevice represents an entry in the output returned by ioreg when passed AppleDeviceManagementHIDEventService
func NewManagedDevice ¶
func NewManagedDevice() *ManagedDevice
func (*ManagedDevice) Add ¶
func (manDev *ManagedDevice) Add(chunk string)
Add takes a chunk of raw text and attempts to parse it as managed device data and create an attribute map from it.
A typical chunk will look like: "LowBatteryNotificationPercentage" = 2 "BatteryFaultNotificationType" = "TPBatteryFault" ... "VersionNumber" = 0 which should become: { "LowBatteryNotificationPercentage": 2, "BatteryFaultNotificationType": "TPBatteryFault", "VersionNumber": 0, }
func (*ManagedDevice) BatteryPercent ¶
func (manDev *ManagedDevice) BatteryPercent() int64
BatteryPercent returns the percent of the device battery
func (*ManagedDevice) BluetoothDevice ¶
func (manDev *ManagedDevice) BluetoothDevice() bool
BluetoothDevice returns whether or not the device supports bluetooth
func (*ManagedDevice) BuiltIn ¶
func (manDev *ManagedDevice) BuiltIn() bool
BuiltIn returns whether or not the device is built into the computer
func (*ManagedDevice) Dump ¶
func (manDev *ManagedDevice) Dump() string
Dump writes out all the device attributes as a single string
func (*ManagedDevice) HasBattery ¶
func (manDev *ManagedDevice) HasBattery() bool
HasBattery returns whether or not the device has a battery
func (*ManagedDevice) Product ¶
func (manDev *ManagedDevice) Product() string
Product returns the name of the device
type ManagedDevices ¶
type ManagedDevices struct { Devices []*ManagedDevice // contains filtered or unexported fields }
ManageDevices are ...
func NewManagedDevices ¶
func NewManagedDevices() *ManagedDevices
func (*ManagedDevices) Refresh ¶
func (manDevices *ManagedDevices) Refresh()
type Widget ¶
type Widget struct { view.TextWidget Battery *Battery ManagedDevices *ManagedDevices // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.