Documentation
¶
Index ¶
- Constants
- func HandleRequest(conn net.Conn, req Request, m *Manager)
- type DBusConn
- type DDCBackend
- 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) NotifySubscribers()
- func (m *Manager) Rescan()
- func (m *Manager) SetBrightness(deviceID string, percent int) 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
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, percent int) error
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 (*Manager) DecrementBrightness ¶
func (*Manager) IncrementBrightness ¶
func (*Manager) NotifySubscribers ¶
func (m *Manager) NotifySubscribers()
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) GetDevices ¶
func (b *SysfsBackend) GetDevices() ([]Device, error)
func (*SysfsBackend) SetBrightness ¶
func (b *SysfsBackend) SetBrightness(id string, percent int) error
Click to show internal directories.
Click to hide internal directories.