Documentation
¶
Overview ¶
Package goyeelight - Control the Yeelight LED Bulb with Go
Index ¶
- type Error
- type ResponseError
- type ResponseOk
- type Result
- type Yeelight
- func (y *Yeelight) CronAdd(t, value string) string
- func (y *Yeelight) CronDel(t string) string
- func (y *Yeelight) CronGet(t string) string
- func (y *Yeelight) GetProp(values string) string
- func (y *Yeelight) Off() string
- func (y *Yeelight) On() string
- func (y *Yeelight) SetAdjust(action, prop string) string
- func (y *Yeelight) SetBright(brightness, effect, duration string) string
- func (y *Yeelight) SetCtAbx(value, effect, duration string) string
- func (y *Yeelight) SetDefault() string
- func (y *Yeelight) SetHSV(hue, sat, effect, duration string) string
- func (y *Yeelight) SetName(name string) string
- func (y *Yeelight) SetPower(power, effect, duration string) string
- func (y *Yeelight) SetRGB(value, effect, duration string) string
- func (y *Yeelight) SetScene(class, values string) string
- func (y *Yeelight) StartCf(count, action, flowExpression string) string
- func (y *Yeelight) StopCf() string
- func (y *Yeelight) Toogle() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseError ¶
ResponseError struct is used on the error responses
type ResponseOk ¶
type ResponseOk struct {
ID int `json:"id"`
Result interface{} `json:"result"`
}
ResponseOk struct is used on the success responses
type Result ¶
type Result struct {
Status bool `json:"status"`
Data interface{} `json:"data"`
}
Result struct is used on the standard response message
type Yeelight ¶
type Yeelight struct {
// contains filtered or unexported fields
}
Yeelight instance. Create an instance of Yeelight, by using New()
func (*Yeelight) CronGet ¶
CronGet method is used to retrieve the setting of the current cron job of the specified type.
func (*Yeelight) SetAdjust ¶
SetAdjust method is used to change brightness, CT or color of a smart LED without knowing the current value, it's main used by controllers.
func (*Yeelight) SetDefault ¶
SetDefault method is used to save current state of smart LED in persistent memory. So if user powers off and then powers on the smart LED again (hard power reset), the smart LED will show last saved state.
func (*Yeelight) SetName ¶
SetName method is used to name the device. The name will be stored on the device and reported in discovering response. User can also read the name through “get_prop” method
func (*Yeelight) SetPower ¶
SetPower method is used to switch on or off the smart LED (software managed on/off).
func (*Yeelight) SetScene ¶
SetScene method is used to set the smart LED directly to specified state. If the smart LED is off, then it will turn on the smart LED firstly and then apply the specified command.
func (*Yeelight) StartCf ¶
StartCf method is used to start a color flow. Color flow is a series of smart LED visible state changing. It can be brightness changing, color changing or color temperature changing.This is the most powerful command. All our recommended scenes, e.g. Sunrise/Sunset effect is implemented using this method. With the flow expression, user can actually “program” the light effect.