YeelightSearch

src/index.js

Create a new instance of the YeelightSearch class and start searching for new Yeelights once a Yeelight has been found it will create an Yeelight instance and emits the 'found' event light the Yeelight instance as payload

new YeelightSearch()

Extends EventEmitter

Instance Members
▸ addLight(lightdata)
▸ getYeelights()
▸ getYeelightById(id)
▸ refresh()

Class Yeelight provides all functionality

new Yeelight(data: any, yeelightData: object)

Extends EventEmitter

Parameters
data (any)
yeelightData (object)
Example
{
 LOCATION: 'yeelight://10.0.0.33:55443',
 ID: '0x0000000000000000',
 SUPPORT: 'get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_rgb set_hsv set_adjust set_music set_name',
 NAME: 'Living Room',
 MODEL: 'color',
}
Instance Members
▸ getId()
▸ getModel()
▸ getName()
▸ setName(name)
▸ getValues(props)
▸ toggle()
▸ setDefaultState()
▸ setColorTemperature(temperature, effect, time)
▸ setBrightness(brightness, effect, time)
▸ turnOn(effect, time)
▸ turnOff(effect, time)
▸ setScene(params)
▸ setRGB(hex, effect, time)
▸ setHSV(hue, saturation, effect, time)
▸ addCron(type, value)
▸ getCron(index, type)
▸ deleteCron(index, type)
▸ setAdjust(action, prop)
▸ setMusicMode(action, host, port)
▸ startColorFlow(count, action, flowExpression)
▸ stopColorFlow()