Documentation
¶
Index ¶
- Constants
- func HandleRequest(conn net.Conn, req Request, m *Manager)
- type DBusConn
- type DDCBackend
- func (b *DDCBackend) Close()
- func (b *DDCBackend) GetDevices() ([]Device, error)
- func (b *DDCBackend) SetBrightness(id string, value int, exponential bool, callback func()) error
- func (b *DDCBackend) SetBrightnessWithExponent(id string, value int, exponential bool, exponent float64, callback func()) error
- type Device
- type DeviceClass
- type DeviceUpdate
- type LogindBackend
- type Manager
- func (m *Manager) Close()
- func (m *Manager) DecrementBrightness(deviceID string, step int) error
- func (m *Manager) GetState() State
- func (m *Manager) IncrementBrightness(deviceID string, step int) error
- func (m *Manager) IncrementBrightnessWithExponent(deviceID string, step int, exponential bool, exponent float64) error
- func (m *Manager) IncrementBrightnessWithMode(deviceID string, step int, exponential bool) error
- func (m *Manager) NotifySubscribers()
- func (m *Manager) Rescan()
- func (m *Manager) SetBrightness(deviceID string, percent int) error
- func (m *Manager) SetBrightnessWithExponent(deviceID string, percent int, exponential bool, exponent float64) error
- func (m *Manager) SetBrightnessWithMode(deviceID string, percent int, exponential bool) error
- func (m *Manager) Subscribe(id string) chan State
- func (m *Manager) SubscribeUpdates(id string) chan DeviceUpdate
- func (m *Manager) Unsubscribe(id string)
- func (m *Manager) UnsubscribeUpdates(id string)
- type Request
- type SetBrightnessParams
- type State
- type SysfsBackend
- func (b *SysfsBackend) GetDevice(id string) (*sysfsDevice, error)
- func (b *SysfsBackend) GetDevices() ([]Device, error)
- func (b *SysfsBackend) PercentToValue(percent int, dev *sysfsDevice, exponential bool) int
- func (b *SysfsBackend) PercentToValueWithExponent(percent int, dev *sysfsDevice, exponential bool, exponent float64) int
- func (b *SysfsBackend) SetBrightness(id string, percent int, exponential bool) error
- func (b *SysfsBackend) SetBrightnessWithExponent(id string, percent int, exponential bool, exponent float64) error
- func (b *SysfsBackend) ValueToPercent(value int, dev *sysfsDevice, exponential bool) int
- func (b *SysfsBackend) ValueToPercentWithExponent(value int, dev *sysfsDevice, exponential bool, exponent float64) int
Constants ¶
View Source
const ( I2C_SLAVE = 0x0703 DDCCI_ADDR = 0x37 DDCCI_VCP_GET = 0x01 DDCCI_VCP_SET = 0x03 VCP_BRIGHTNESS = 0x10 DDC_SOURCE_ADDR = 0x51 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DDCBackend ¶
type DDCBackend struct {
// contains filtered or unexported fields
}
func NewDDCBackend ¶
func NewDDCBackend() (*DDCBackend, error)
func (*DDCBackend) Close ¶
func (b *DDCBackend) Close()
func (*DDCBackend) GetDevices ¶
func (b *DDCBackend) GetDevices() ([]Device, error)
func (*DDCBackend) SetBrightness ¶
func (b *DDCBackend) SetBrightness(id string, value int, exponential bool, callback func()) error
func (*DDCBackend) SetBrightnessWithExponent ¶ added in v0.4.1
type DeviceClass ¶
type DeviceClass string
const ( ClassBacklight DeviceClass = "backlight" ClassLED DeviceClass = "leds" ClassDDC DeviceClass = "ddc" )
type DeviceUpdate ¶
type DeviceUpdate struct {
Device Device `json:"device"`
}
type LogindBackend ¶
type LogindBackend struct {
// contains filtered or unexported fields
}
func NewLogindBackend ¶
func NewLogindBackend() (*LogindBackend, error)
func NewLogindBackendWithConn ¶
func NewLogindBackendWithConn(conn DBusConn) *LogindBackend
func (*LogindBackend) Close ¶
func (b *LogindBackend) Close()
func (*LogindBackend) SetBrightness ¶
func (b *LogindBackend) SetBrightness(subsystem, name string, brightness uint32) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManagerWithOptions ¶ added in v0.4.0
func (*Manager) DecrementBrightness ¶
func (*Manager) IncrementBrightness ¶
func (*Manager) IncrementBrightnessWithExponent ¶ added in v0.4.1
func (*Manager) IncrementBrightnessWithMode ¶ added in v0.4.0
func (*Manager) NotifySubscribers ¶
func (m *Manager) NotifySubscribers()
func (*Manager) SetBrightnessWithExponent ¶ added in v0.4.1
func (*Manager) SetBrightnessWithMode ¶ added in v0.4.0
func (*Manager) SubscribeUpdates ¶
func (m *Manager) SubscribeUpdates(id string) chan DeviceUpdate
func (*Manager) Unsubscribe ¶
func (*Manager) UnsubscribeUpdates ¶
type SetBrightnessParams ¶
type SysfsBackend ¶
type SysfsBackend struct {
// contains filtered or unexported fields
}
func NewSysfsBackend ¶
func NewSysfsBackend() (*SysfsBackend, error)
func (*SysfsBackend) GetDevice ¶ added in v0.4.0
func (b *SysfsBackend) GetDevice(id string) (*sysfsDevice, error)
func (*SysfsBackend) GetDevices ¶
func (b *SysfsBackend) GetDevices() ([]Device, error)
func (*SysfsBackend) PercentToValue ¶ added in v0.4.0
func (b *SysfsBackend) PercentToValue(percent int, dev *sysfsDevice, exponential bool) int
func (*SysfsBackend) PercentToValueWithExponent ¶ added in v0.4.1
func (b *SysfsBackend) PercentToValueWithExponent(percent int, dev *sysfsDevice, exponential bool, exponent float64) int
func (*SysfsBackend) SetBrightness ¶
func (b *SysfsBackend) SetBrightness(id string, percent int, exponential bool) error
func (*SysfsBackend) SetBrightnessWithExponent ¶ added in v0.4.1
func (*SysfsBackend) ValueToPercent ¶ added in v0.4.0
func (b *SysfsBackend) ValueToPercent(value int, dev *sysfsDevice, exponential bool) int
func (*SysfsBackend) ValueToPercentWithExponent ¶ added in v0.4.1
func (b *SysfsBackend) ValueToPercentWithExponent(value int, dev *sysfsDevice, exponential bool, exponent float64) int
Click to show internal directories.
Click to hide internal directories.