Documentation ¶
Index ¶
- Variables
- type Animation
- type Brightness
- type ColorTemprature
- type ColorTempratureKeyframe
- type Command
- type Commander
- type Conn
- type Device
- type GetPropCommand
- type Hue
- type IllegalArgumentError
- type Keyframe
- type Notification
- type NotificationParams
- type RGB
- type RGBKeyframe
- type RawKeyframe
- type Result
- type Saturation
- type SetBrightnessCommand
- type SetBrightnessNormCommand
- type SetColorTempratureCommand
- type SetColorTempratureNormCommand
- type SetDefaultCommand
- type SetHSVCommand
- type SetHSVNormCommand
- type SetNameCommand
- type SetPowerCommand
- type SetRGBCommand
- type SetRGBNormCommand
- type SleepKeyframe
- type StartColorFlowCommand
- type StopColorFlowCommand
- type ToggleCommand
- type WhiteKeyframe
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosing = errors.New("connection closing")
View Source
var ErrTimeout = errors.New("command timeout")
Functions ¶
This section is empty.
Types ¶
type Brightness ¶
type Brightness int
func NewBrightnessNorm ¶
func NewBrightnessNorm(v float64) Brightness
func (Brightness) Int ¶
func (b Brightness) Int() int
func (Brightness) Validate ¶
func (b Brightness) Validate() error
type ColorTemprature ¶
type ColorTemprature int
func (ColorTemprature) Int ¶
func (c ColorTemprature) Int() int
func (ColorTemprature) Validate ¶
func (c ColorTemprature) Validate() error
type ColorTempratureKeyframe ¶
func (ColorTempratureKeyframe) Expression ¶
func (r ColorTempratureKeyframe) Expression() (string, error)
type Command ¶
type Command struct { ID int `json:"id"` Method string `json:"method"` Params []interface{} `json:"params"` // contains filtered or unexported fields }
Command .
type Conn ¶
type Conn struct { Device Device NotificationC chan Notification // contains filtered or unexported fields }
Conn .
type Device ¶
type Device struct { CacheControl string Location string ID string Model string // mono, color, stripe FirmwareVersion string Support map[string]bool Power string Flowing int FlowParams string Brightness int ColorMode int ColorTemprature int RGB int Hue int Saturation int Name string }
func (*Device) LocationAddr ¶
type GetPropCommand ¶
type GetPropCommand struct {
Properties []string
}
GetPropCommand .
func (GetPropCommand) Command ¶
func (g GetPropCommand) Command() (Command, error)
type IllegalArgumentError ¶
type IllegalArgumentError struct {
// contains filtered or unexported fields
}
func (IllegalArgumentError) Error ¶
func (e IllegalArgumentError) Error() string
type Notification ¶
type Notification struct { DeviceID string Method string Params NotificationParams }
Notification .
type NotificationParams ¶
type NotificationParams struct { Bright *int `json:"bright"` CT *int `json:"ct"` RGB *int `json:"rgb"` Power *string `json:"power"` Hue *int `json:"hue"` Sat *int `json:"sat"` ColorMode *int `json:"color_mode"` Flowing *int `json:"flowing"` DelayOff *int `json:"delayoff"` FlowParams *string `json:"flow_params"` MusicOn *int `json:"music_on"` Name *string `json:"name"` }
NotificationParams .
type RGBKeyframe ¶
func (RGBKeyframe) Expression ¶
func (r RGBKeyframe) Expression() (string, error)
type RawKeyframe ¶
type RawKeyframe struct {
RawExpression string
}
RawKeyframe .
func (RawKeyframe) Expression ¶
func (r RawKeyframe) Expression() (string, error)
type Saturation ¶
type Saturation int
func NewSaturationNorm ¶
func NewSaturationNorm(v float64) Saturation
func (Saturation) Int ¶
func (s Saturation) Int() int
func (Saturation) Validate ¶
func (s Saturation) Validate() error
type SetBrightnessCommand ¶
type SetBrightnessCommand struct { Brightness int `json:"brightness"` Duration time.Duration `json:"duration"` }
SetBrightnessCommand .
func (SetBrightnessCommand) Command ¶
func (s SetBrightnessCommand) Command() (Command, error)
type SetBrightnessNormCommand ¶
SetBrightnessNormCommand .
func (SetBrightnessNormCommand) Command ¶
func (s SetBrightnessNormCommand) Command() (Command, error)
type SetColorTempratureCommand ¶
SetColorTempratureCommand .
func (SetColorTempratureCommand) Command ¶
func (c SetColorTempratureCommand) Command() (Command, error)
type SetColorTempratureNormCommand ¶
SetColorTempratureNormCommand .
type SetDefaultCommand ¶
type SetDefaultCommand struct { }
SetDefaultCommand .
func (SetDefaultCommand) Command ¶
func (c SetDefaultCommand) Command() (Command, error)
type SetHSVCommand ¶
SetHSVCommand .
func (SetHSVCommand) Command ¶
func (s SetHSVCommand) Command() (Command, error)
type SetHSVNormCommand ¶
SetHSVCommand .
func (SetHSVNormCommand) Command ¶
func (s SetHSVNormCommand) Command() (Command, error)
type SetNameCommand ¶
type SetNameCommand struct {
Name string
}
SetNameCommand .
func (SetNameCommand) Command ¶
func (c SetNameCommand) Command() (Command, error)
type SetPowerCommand ¶
SetPowerCommand .
func (SetPowerCommand) Command ¶
func (s SetPowerCommand) Command() (Command, error)
type SetRGBCommand ¶
func (SetRGBCommand) Command ¶
func (s SetRGBCommand) Command() (Command, error)
type SetRGBNormCommand ¶
func (SetRGBNormCommand) Command ¶
func (s SetRGBNormCommand) Command() (Command, error)
type SleepKeyframe ¶
func (SleepKeyframe) Expression ¶
func (r SleepKeyframe) Expression() (string, error)
type StartColorFlowCommand ¶
StartColorFlowCommand .
func (StartColorFlowCommand) Command ¶
func (s StartColorFlowCommand) Command() (Command, error)
type StopColorFlowCommand ¶
type StopColorFlowCommand struct{}
StopColorFlowCommand .
func (StopColorFlowCommand) Command ¶
func (c StopColorFlowCommand) Command() (Command, error)
type ToggleCommand ¶
type ToggleCommand struct { }
ToggleCommand .
func (ToggleCommand) Command ¶
func (c ToggleCommand) Command() (Command, error)
type WhiteKeyframe ¶
func (WhiteKeyframe) Expression ¶
func (r WhiteKeyframe) Expression() (string, error)
Click to show internal directories.
Click to hide internal directories.