Skip to content

Latest commit

 

History

History
194 lines (101 loc) · 3.71 KB

DOCS.md

File metadata and controls

194 lines (101 loc) · 3.71 KB

Device

Represents a Yeelight device

constructor

Constructor

Parameters

sendCommand

Send command to device

Parameters

Returns Promise<>

powerOn

Power on/off the device

Parameters

Returns Promise<>

createDeviceFromMessage

Create a Device instance from a raw message

Parameters

Returns Device

Discover

Extends EventEmitter

Discover Yeelight devices on demand

constructor

Constructor

discover

Start discovery of Yeelight Devices. It will send a multicast message and wait for response. Emits message event on response.

Returns Any

stop

Stop discovery

Logger

Logger class

constructor

Constructor

Parameters

info

Log an info message

Parameters

Returns Any

Store

MemoryStore

Extends Store

Memory store for Yeelight devices

constructor

Constructor

add

Add a Device to the store

Parameters

Returns Any

getById

Get Device by Id

Parameters

Returns (Device | Any)

removeById

Remove Device from the store

Parameters

Returns Any

get

Get all devices

Returns Array<Device>

Watch

Extends EventEmitter

Class for watching for advertisments packets from Yeelight devices.

constructor

Constructor

watch

Start listening for advertisments packets from Yeelight devices. Emits message event on response.

Returns Any

stop

Stop watching

Yeelight

Extends EventEmitter

Device manager for your Yeelight devices

constructor

Constructor

Parameters

discover

Start the discovery of connected Yeelight devices. Return devices found after discoveryTimeout.

Parameters

Returns Promise<Array<Device>>

watch

Start watching for advertisment packets of Yeelight devices. Emits devices on device event.

Returns Any

stop

Stop watching

Returns Any