SinricPro Library
Loading...
Searching...
No Matches
PowerStateController< T >

PowerStateController. More...

#include <PowerStateController.h>

Inheritance diagram for PowerStateController< T >:

Public Member Functions

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

template<typename T>
class SINRICPRO_3_0_0::PowerStateController< T >

PowerStateController.

Member Function Documentation

◆ onPowerState()

template<typename T >
void onPowerState ( PowerStateCallback  cb)

Set callback function for powerState request.

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

◆ sendPowerStateEvent()

template<typename T >
bool sendPowerStateEvent ( bool  state,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)

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