Automatic Curtain  MVP
Software repository for an automatic curtain using stepper motor, TMC2209 and ESP32
AlexaInteraction Class Reference

#include <alexa_interaction.h>

Inheritance diagram for AlexaInteraction:
Collaboration diagram for AlexaInteraction:

Public Member Functions

 AlexaInteraction (std::shared_ptr< Logging > &logging, String device_id)
 Construct a new AlexaInteraction object, initializes fauxmoesp. More...
 
 ~AlexaInteraction ()
 Destroy the AlexaInteraction object. More...
 
std::tuple< bool, CONFIG_SET::MOTION_REQUESTGetAlexaRequest ()
 Get the latest Alexa Request object. More...
 
void HandleFauxmo ()
 Handler function for the class. More...
 
void SetState (CONFIG_SET::MOTION_REQUEST request)
 Set the object state to alexa. More...
 

Static Private Member Functions

static void Callback (unsigned char id, const char *device_name, bool state, unsigned char percentage)
 Gets called by fauxmo esp when a alexa calls the device. More...
 

Private Attributes

std::shared_ptr< Logginglogger_
 

Static Private Attributes

static std::mutex alexa_request_mutex_
 
static String device_id_ = CONFIG_SET::DEFAULT_DEVICE_ID
 
static bool is_new_request_available_ = false
 
static CONFIG_SET::MOTION_REQUEST latest_alexa_request_ = CONFIG_SET::MOTION_REQUEST()
 

Constructor & Destructor Documentation

◆ AlexaInteraction()

AlexaInteraction::AlexaInteraction ( std::shared_ptr< Logging > &  logging,
String  device_id 
)

Construct a new AlexaInteraction object, initializes fauxmoesp.

Here is the call graph for this function:

◆ ~AlexaInteraction()

AlexaInteraction::~AlexaInteraction ( )

Destroy the AlexaInteraction object.

Member Function Documentation

◆ Callback()

void AlexaInteraction::Callback ( unsigned char  id,
const char *  device_name,
bool  state,
unsigned char  percentage 
)
staticprivate

Gets called by fauxmo esp when a alexa calls the device.

Parameters
iddevice id number
device_namedevice name
stateon/off bool
percentage0-100 percentage
Here is the caller graph for this function:

◆ GetAlexaRequest()

std::tuple< bool, CONFIG_SET::MOTION_REQUEST > AlexaInteraction::GetAlexaRequest ( )

Get the latest Alexa Request object.

Returns
std::tuple<bool, CONFIG_SET::MOTION_REQUEST>

◆ HandleFauxmo()

void AlexaInteraction::HandleFauxmo ( )

Handler function for the class.

◆ SetState()

void AlexaInteraction::SetState ( CONFIG_SET::MOTION_REQUEST  request)

Set the object state to alexa.

Member Data Documentation

◆ alexa_request_mutex_

std::mutex AlexaInteraction::alexa_request_mutex_
staticprivate

◆ device_id_

String AlexaInteraction::device_id_ = CONFIG_SET::DEFAULT_DEVICE_ID
staticprivate

◆ is_new_request_available_

bool AlexaInteraction::is_new_request_available_ = false
staticprivate

◆ latest_alexa_request_

CONFIG_SET::MOTION_REQUEST AlexaInteraction::latest_alexa_request_ = CONFIG_SET::MOTION_REQUEST()
staticprivate

◆ logger_

std::shared_ptr<Logging> AlexaInteraction::logger_
private

The documentation for this class was generated from the following files: