SinricPro Library
Loading...
Searching...
No Matches
SinricProLight

Device to control a light. More...

#include <SinricProLight.h>

Inheritance diagram for SinricProLight:

Public Member Functions

bool sendPushNotification (String notification)
 Sending push notifications to SinricPro App.
 
void onPowerState (PowerStateCallback cb)
 Set callback function for powerState request.
 
bool sendPowerStateEvent (bool state, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setPowerState event to SinricPro Server indicating actual power state.
 
void onBrightness (BrightnessCallback cb)
 Set callback function for setBrightness request.
 
void onAdjustBrightness (AdjustBrightnessCallback cb)
 Set callback function for adjustBrightness request.
 
bool sendBrightnessEvent (int brightness, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setBrightness event to SinricPro Server indicating actual brightness.
 
void onColor (ColorCallback cb)
 Set callback function for setColor request.
 
bool sendColorEvent (byte r, byte g, byte b, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setColor event to SinricPro Server indicating actual color.
 
void onColorTemperature (ColorTemperatureCallback cb)
 Set callback function for setColorTemperature request.
 
void onIncreaseColorTemperature (IncreaseColorTemperatureCallback cb)
 Set callback function for increaseColorTemperature request.
 
void onDecreaseColorTemperature (DecreaseColorTemperatureCallback cb)
 Set callback function for decreaseColorTemperature request.
 
bool sendColorTemperatureEvent (int colorTemperature, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setColorTemperature event to SinricPro Server indicating actual color temperature.
 

Detailed Description

Device to control a light.

Supporting

  • On / Off
  • Brightness (0..100)
  • Color (RGB)
  • Color temperature

Member Function Documentation

◆ onAdjustBrightness()

void onAdjustBrightness ( AdjustBrightnessCallback  cb)
inherited

Set callback function for adjustBrightness request.

Parameters
cbFunction pointer to a AdjustBrightnessCallback function
Returns
void
See also
AdjustBrightnessCallback

◆ onBrightness()

void onBrightness ( BrightnessCallback  cb)
inherited

Set callback function for setBrightness request.

Parameters
cbFunction pointer to a BrightnessCallback function
Returns
void
See also
BrightnessCallback

◆ onColor()

void onColor ( ColorCallback  cb)
inherited

Set callback function for setColor request.

Parameters
cbFunction pointer to a ColorCallback function
Returns
void
See also
ColorCallback

◆ onColorTemperature()

void onColorTemperature ( ColorTemperatureCallback  cb)
inherited

Set callback function for setColorTemperature request.

Parameters
cbFunction pointer to a ColorTemperatureCallback function
Returns
void
See also
ColorTemperatureCallback

◆ onDecreaseColorTemperature()

void onDecreaseColorTemperature ( DecreaseColorTemperatureCallback  cb)
inherited

Set callback function for decreaseColorTemperature request.

Parameters
cbFunction pointer to a DecreaseColorTemperatureCallback function
Returns
void
See also
DecreaseColorTemperatureCallback

◆ onIncreaseColorTemperature()

void onIncreaseColorTemperature ( IncreaseColorTemperatureCallback  cb)
inherited

Set callback function for increaseColorTemperature request.

Parameters
cbFunction pointer to a IncreaseColorTemperatureCallback function
Returns
void
See also
IncreaseColorTemperatureCallback

◆ onPowerState()

void onPowerState ( PowerStateCallback  cb)
inherited

Set callback function for powerState request.

Parameters
cbFunction pointer to a PowerStateCallback function
Returns
void
See also
PowerStateCallback

◆ sendBrightnessEvent()

bool sendBrightnessEvent ( int  brightness,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setBrightness event to SinricPro Server indicating actual brightness.

Parameters
brightnessInteger value with actual brightness the device is set to
cause(optional) String reason why event is sent (default = "PHYSICAL_INTERACTION")
Returns
the success of sending the even
Return values
trueevent has been sent successfully
falseevent has not been sent, maybe you sent to much events in a short distance of time

◆ sendColorEvent()

bool sendColorEvent ( byte  r,
byte  g,
byte  b,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setColor event to SinricPro Server indicating actual color.

Parameters
rByte value for red
gByte value for green
bByte value for blue
cause(optional) String reason why event is sent (default = "PHYSICAL_INTERACTION")
Returns
the success of sending the even
Return values
trueevent has been sent successfully
falseevent has not been sent, maybe you sent to much events in a short distance of time

◆ sendColorTemperatureEvent()

bool sendColorTemperatureEvent ( int  colorTemperature,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setColorTemperature event to SinricPro Server indicating actual color temperature.

Parameters
colorTemperatureInteger with new color temperature the device is set to
2200 = warm white
2700 = soft white
4000 = white
5500 = daylight white
7000 = cool white
cause(optional) String reason why event is sent (default = "PHYSICAL_INTERACTION")
Returns
the success of sending the even
Return values
trueevent has been sent successfully
falseevent has not been sent, maybe you sent to much events in a short distance of time

◆ sendPowerStateEvent()

bool sendPowerStateEvent ( bool  state,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setPowerState event to SinricPro Server indicating actual power state.

Parameters
statetrue = device turned on
false = device turned off
cause(optional) String reason why event is sent (default = "PHYSICAL_INTERACTION")
Returns
the success of sending the even
Return values
trueevent has been sent successfully
falseevent has not been sent, maybe you sent to much events in a short distance of time

◆ sendPushNotification()

bool sendPushNotification ( String  notification)
inherited

Sending push notifications to SinricPro App.

Parameters
notificationString with the notification
Returns
the success of sending the event
Return values
trueevent has been sent successfully
falseevent has not been sent, maybe you sent to much events in a short distance of time