SinricPro Library
Loading...
Searching...
No Matches
SinricProSpeaker

Device to control a smart speaker. More...

#include <SinricProSpeaker.h>

Inheritance diagram for SinricProSpeaker:

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 onMute (MuteCallback cb)
 Set callback function for setMute request.
 
bool sendMuteEvent (bool mute, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setMute event to SinricPro Server indicating actual mute state.
 
void onSetVolume (SetVolumeCallback cb)
 Set callback function for setVolume request.
 
void onAdjustVolume (AdjustVolumeCallback cb)
 Set callback function for adjustVolume request.
 
bool sendVolumeEvent (int volume, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setVolume event to SinricPro Server indicating actual volume has changed.
 
void onMediaControl (MediaControlCallback cb)
 Set callback function for mediaControl request.
 
bool sendMediaControlEvent (String mediaControl, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send mediaControl event to SinricPro Server indicating devices media control state.
 
void onSelectInput (SelectInputCallback cb)
 Set callback function for selectInput request.
 
bool sendSelectInputEvent (String intput, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send selectInput event to SinricPro Server to report selected input.
 
void onSetBands (SetBandsCallback cb)
 Set callback function for setBands request.
 
void onAdjustBands (AdjustBandsCallback cb)
 Set callback function for adjustBands request.
 
void onResetBands (ResetBandsCallback cb)
 Set callback function for resetBands request.
 
bool sendBandsEvent (String bands, int level, String cause="PHYSICAL_INTERACTION")
 Send setBands event to SinricPro Server indicating bands level has changed.
 
void onSetMode (ModeCallback cb)
 Set callback function for setMode request.
 
void onSetMode (const String &instance, GenericModeCallback cb)
 Set callback function for setMode request on a specific instance.
 
bool sendModeEvent (String mode, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setMode event to SinricPro Server indicating the mode has changed.
 
bool sendModeEvent (String instance, String mode, String cause=FSTR_SINRICPRO_PHYSICAL_INTERACTION)
 Send setMode event to SinricPro Server indicating the mode on a specific instance has changed.
 

Detailed Description

Device to control a smart speaker.

Supporting:

  • setVolume / adjustVolume
  • set / adjust / reset bands (BASS, MIDRANGE, TREBBLE)
  • mute / unmute
  • media controls:
    • FastForward
    • Next
    • Pause
    • Play
    • Previous
    • Rewind
    • StartOver
    • Stop
  • set mode (TV, MOVIE, ...)

Member Function Documentation

◆ onAdjustBands()

void onAdjustBands ( AdjustBandsCallback  cb)
inherited

Set callback function for adjustBands request.

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

◆ onAdjustVolume()

void onAdjustVolume ( AdjustVolumeCallback  cb)
inherited

Set callback function for adjustVolume request.

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

◆ onMediaControl()

void onMediaControl ( MediaControlCallback  cb)
inherited

Set callback function for mediaControl request.

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

◆ onMute()

void onMute ( MuteCallback  cb)
inherited

Set callback function for setMute request.

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

◆ onPowerState()

void onPowerState ( PowerStateCallback  cb)
inherited

Set callback function for powerState request.

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

◆ onResetBands()

void onResetBands ( ResetBandsCallback  cb)
inherited

Set callback function for resetBands request.

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

◆ onSelectInput()

void onSelectInput ( SelectInputCallback  cb)
inherited

Set callback function for selectInput request.

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

◆ onSetBands()

void onSetBands ( SetBandsCallback  cb)
inherited

Set callback function for setBands request.

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

◆ onSetMode() [1/2]

void onSetMode ( const String &  instance,
GenericModeCallback  cb 
)
inherited

Set callback function for setMode request on a specific instance.

Parameters
instanceString with instance name
cbFunction pointer to a ModeCallback function
Returns
void
See also
ModeCallback

◆ onSetMode() [2/2]

void onSetMode ( ModeCallback  cb)
inherited

Set callback function for setMode request.

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

◆ onSetVolume()

void onSetVolume ( SetVolumeCallback  cb)
inherited

Set callback function for setVolume request.

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

◆ sendBandsEvent()

bool sendBandsEvent ( String  bands,
int  level,
String  cause = "PHYSICAL_INTERACTION" 
)
inherited

Send setBands event to SinricPro Server indicating bands level has changed.

Parameters
bandsString which bands has changed
BASS, MIDRANGE, TREBBLE
levelInteger with changed bands level
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

◆ sendMediaControlEvent()

bool sendMediaControlEvent ( String  mediaControl,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send mediaControl event to SinricPro Server indicating devices media control state.

Parameters
mediaControlString with actual media control
FastForward, Next, Pause, Play, Previous, Rewind, StartOver, Stop
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

◆ sendModeEvent() [1/2]

bool sendModeEvent ( String  instance,
String  mode,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setMode event to SinricPro Server indicating the mode on a specific instance has changed.

Parameters
instanceString instance name
modeString with actual mode device is set to
MOVIE, MUSIC, NIGHT, SPORT, TV
cause(optional) String reason why event is sent (default = FSTR_SINRICPRO_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

◆ sendModeEvent() [2/2]

bool sendModeEvent ( String  mode,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setMode event to SinricPro Server indicating the mode has changed.

Parameters
modeString with actual mode device is set to
MOVIE, MUSIC, NIGHT, SPORT, TV
cause(optional) String reason why event is sent (default = FSTR_SINRICPRO_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

◆ sendMuteEvent()

bool sendMuteEvent ( bool  mute,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setMute event to SinricPro Server indicating actual mute state.

Parameters
mutetrue = device is muted on
false = device is unmuted
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

◆ sendSelectInputEvent()

bool sendSelectInputEvent ( String  input,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send selectInput event to SinricPro Server to report selected input.

Parameters
inputString with actual media control
AUX 1..AUX 7, BLURAY, CABLE, CD, COAX 1,COAX 2, COMPOSITE 1, DVD, GAME, HD RADIO, HDMI 1.. HDMI 10, HDMI ARC, INPUT 1..INPUT 10, IPOD, LINE 1..LINE 7, MEDIA PLAYER, OPTICAL 1, OPTICAL 2, PHONO, PLAYSTATION, PLAYSTATION 3, PLAYSTATION 4, SATELLITE, SMARTCAST, TUNER, TV, USB DAC, VIDEO 1..VIDEO 3, XBOX
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

◆ sendVolumeEvent()

bool sendVolumeEvent ( int  volume,
String  cause = FSTR_SINRICPRO_PHYSICAL_INTERACTION 
)
inherited

Send setVolume event to SinricPro Server indicating actual volume has changed.

Parameters
volumeInteger reporting the volume that the device have been set to
cause(optional) Reason why event is sent (default = "PHYSICAL_INTERACTION")
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