Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
YeelightBulb Class Reference

Yeelight wifi bulb controller class. More...

#include <YeelightBulb.h>

Public Member Functions

 YeelightBulb (IPAddress addr)
 
bool connect ()
 Can be skipped. This method will be called automatically from any action method below. More...
 
void sendCommand (String method, Vector< String > params)
 Send any command to the lamp. More...
 
void on ()
 
void off ()
 
void setState (bool isOn)
 
void updateState ()
 Start async reading of current lamp state. More...
 
YeelightBulbState currentState ()
 Get current lamp state (should be called only after updateState) More...
 
void setBrightness (int percent)
 
void setRGB (byte r, byte g, byte b)
 
void setHSV (int hue, int sat)
 

Protected Member Functions

void ensureOn ()
 
bool onResponse (TcpClient &client, char *data, int size)
 
void parsePower (const String &resp)
 

Detailed Description

Yeelight wifi bulb controller class.

Member Function Documentation

bool YeelightBulb::connect ( )

Can be skipped. This method will be called automatically from any action method below.

YeelightBulbState YeelightBulb::currentState ( )
inline

Get current lamp state (should be called only after updateState)

void YeelightBulb::sendCommand ( String  method,
Vector< String params 
)

Send any command to the lamp.

void YeelightBulb::updateState ( )

Start async reading of current lamp state.