Sets or gets the default captureRejection value for all emitters.
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
This method is used to adjust the brightness by specified percentage within specified duration.
the percentage to be adjusted. The range is: -100 ~ 100
the milisecond of animation
return a promise of IEventResult
establish connection to light,
return promise of the current instance
This method is used to start a timer job on the smart LED. Only accepted if the smart LED is currently in "on" state
currently can only be 0. (means power off)
the length of the timer (in minutes). Request
return a promise of IEventResult
This method is used to retrieve the setting of the current cron job of the specified type.
currently can only be 0. (means power off)
return a promise of IEventResult
This method is used to retrieve the setting of the current cron job of the specified type.
currently can only be 0. (means power off)
return a promise of IEventResult
Drop connection/listerners and clean up resources.
This method is used to retrieve current property of smart LED.
The parameter is a list of property names and the response contains a list of corresponding property values. the requested property name is not recognized by smart LED, then a empty string value ("") will be returned. Request Example: {"id":1,"method":"get_prop","params":["power", "not_exist", "bright"]} Example: {"id":1, "result":["on", "", "100"]}
return a promise of IEventResult
This method is used to just check if the connection is alive
Use this function to send any command to the light, please refer to specification to know the structure of command data
The command to send to light via socket write
return a promise of IEventResult
the direction of the adjustment. The valid value can be: increase: increase the specified property decrease: decrease the specified property circle: increase the specified property, after it reaches the max value back to minimum value
the property to adjust. The valid value can be: “bright": adjust brightness. “ct": adjust color temperature. “color": adjust color. (When “prop" is “color", the “action" can only be “circle", otherwise, it will be deemed as invalid request.)
return a promise of IEventResult
This method is used to change the color of a smart LED. Only accepted if the smart LED is currently in "on" state.
is the target brightness. The type is integer and ranges from 1 to 100. The brightness is a percentage instead of a absolute value. 100 means maximum brightness while 1 means the minimum brightness.
support two values: "sudden" and "smooth". If effect is "sudden", then the color temperature will be changed directly to target value, under this case, the third parameter "duration" is ignored. If effect is "smooth", then the color temperature will be changed to target value in a gradual fashion, under this case, the total time of gradual change is specified in third parameter "duration".
specifies the total time of the gradual changing. The unit is milliseconds. The minimum support duration is 30 milliseconds.
return a promise of IEventResult
This method is used to change the color temperature of a smart LED.
the target color temperature. The type is integer and range is 1700 ~ 6500 (k).
support two values: "sudden" and "smooth". If effect is "sudden", then the color temperature will be changed directly to target value, under this case, the third parameter "duration" is ignored. If effect is "smooth", then the color temperature will be changed to target value in a gradual fashion, under this case, the total time of gradual change is specified in third parameter "duration".
specifies the total time of the gradual changing. The unit is milliseconds. The minimum support duration is 30 milliseconds.
return a promise of IEventResult
This 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. For example, if user likes the current color (red) and brightness (50%) and want to make this state as a default initial state (every time the smart LED is powered), then he can use set_default to do a snapshot.
return a promise of IEventResult
This method is used to change the color of a smart LED. Only accepted if the smart LED is currently in "on" state.
the target hue, whose type is integer. It should be expressed in decimal integer ranges from 0 to 359.
the target saturation, whose type is integer. It should be expressed in decimal integer ranges from 0 to 100.
support two values: "sudden" and "smooth". If effect is "sudden", then the color temperature will be changed directly to target value, under this case, the third parameter "duration" is ignored. If effect is "smooth", then the color temperature will be changed to target value in a gradual fashion, under this case, the total time of gradual change is specified in third parameter "duration".
specifies the total time of the gradual changing. The unit is milliseconds. The minimum support duration is 30 milliseconds.
return a promise of IEventResult
This method is used to start or stop music mode on a device. Under music mode, no property will be reported and no message quota is checked.
the action of set_music command. The valid value can be: 0: turn off music mode. 1: turn on music mode.
the IP address of the music server.
the TCP port music application is listening on. When control device wants to start music mode, it needs start a TCP server firstly and then call “set_music” command to let the device know the IP and Port of the TCP listen socket. After received the command, LED device will try to connect the specified peer address. If the TCP connection can be established successfully, then control device could send all supported commands through this channel without limit to simulate any music effect. The control device can stop music mode by explicitly send a stop command or just by closing the socket.
return a promise of IEventResult
This 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
the name of the device. When using Yeelight official App, the device name is stored on cloud. This method instead store the name on persistent memory of the device, so the two names could be different.
return a promise of IEventResult
This method is used to change the color of a smart LED. Only accepted if the smart LED is currently in "on" state.
the target color, whose type is integer. It should be expressed in decimal integer ranges from 0 to 16777215 (hex: 0xFFFFFF). can be initial by new Color(233,255,244)
support two values: "sudden" and "smooth". If effect is "sudden", then the color temperature will be changed directly to target value, under this case, the third parameter "duration" is ignored. If effect is "smooth", then the color temperature will be changed to target value in a gradual fashion, under this case, the total time of gradual change is specified in third parameter "duration".
specifies the total time of the gradual changing. The unit is milliseconds. The minimum support duration is 30 milliseconds.
return a promise of IEventResult
This 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
type of scene to update
return a promise of IEventResult
This 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.
is the total number of visible state changing before color flow stopped. 0 means infinite loop on the state changing. @default infinity
return a promise of IEventResult
This method is used to stop a running color flow.
This method is used to toggle the smart LED. This method is used to switch on or off the smart LED (software managed on/off)
Return the promise indicate the command success or reject
Returns a list listener for a specific emitter event name.
Generated using TypeDoc
The client to connect and control the light