Represents a Yeelight device
Constructor
Parameters
payload
Object
Send command to device
Parameters
command
Object
Returns Promise<>
Power on/off the device
Parameters
Returns Promise<>
Create a Device instance from a raw message
Parameters
msg
Buffer
Returns Device
Extends EventEmitter
Discover Yeelight devices on demand
Constructor
Start discovery of Yeelight Devices. It will send a multicast message
and wait for response. Emits message
event on response.
Returns Any
Stop discovery
Logger class
Constructor
Parameters
options
Object
Log an info message
Parameters
msg
string
Returns Any
Extends Store
Memory store for Yeelight devices
Constructor
Add a Device to the store
Parameters
device
Device
Returns Any
Get Device by Id
Parameters
id
string
Returns (Device | Any)
Remove Device from the store
Parameters
id
string
Returns Any
Get all devices
Extends EventEmitter
Class for watching for advertisments packets from Yeelight devices.
Constructor
Start listening for advertisments packets from Yeelight
devices. Emits message
event on response.
Returns Any
Stop watching
Extends EventEmitter
Device manager for your Yeelight devices
Constructor
Parameters
options
Object
Start the discovery of connected Yeelight devices. Return
devices found after discoveryTimeout
.
Parameters
discoveryTimeout
number
Returns Promise<Array<Device>>
Start watching for advertisment packets of Yeelight devices.
Emits devices on device
event.
Returns Any
Stop watching
Returns Any