SinricPro Library
Loading...
Searching...
No Matches
SinricProSwitch

Device suporting basic on / off command. More...

#include <SinricProSwitch.h>

Inheritance diagram for SinricProSwitch:

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.
 

Detailed Description

Device suporting basic on / off command.

Member Function Documentation

◆ onPowerState()

void onPowerState ( PowerStateCallback  cb)
inherited

Set callback function for powerState request.

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

◆ 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