CloudConfigRK
Public Member Functions | Protected Attributes
CloudConfigUpdateWebhook Class Reference

Update configuration from data retrieved from a webhook. More...

#include <CloudConfigRK.h>

Inheritance diagram for CloudConfigUpdateWebhook:
CloudConfigUpdateSubscription CloudConfigUpdate

Public Member Functions

 CloudConfigUpdateWebhook ()
 Default constructor.
 
 CloudConfigUpdateWebhook (const char *eventName)
 Constructor with event name. More...
 
CloudConfigUpdateWebhookwithEventName (const char *eventName)
 Method to set the event name to for the webhook. More...
 
virtual void startUpdate ()
 Called when a JSON data update is requested.
 
- Public Member Functions inherited from CloudConfigUpdateSubscription
 CloudConfigUpdateSubscription ()
 Default constructor.
 
 CloudConfigUpdateSubscription (const char *eventName)
 Constructor with event name. More...
 
CloudConfigUpdateSubscriptionwithEventName (const char *eventName)
 Method to set the event name to subscribe to. More...
 
virtual void setup ()
 Called during setup() More...
 
void subscriptionHandler (const char *eventName, const char *eventData)
 Handler called when the event is received.
 
- Public Member Functions inherited from CloudConfigUpdate
 CloudConfigUpdate ()
 Default constructor.
 
virtual void loop ()
 Called during loop() to allow update methods to have loop time. More...
 

Protected Attributes

String requestEventName
 Event name passed to constructor or withEventName. Used during setup(). More...
 
- Protected Attributes inherited from CloudConfigUpdateSubscription
String eventName
 Subscribed event name passed to constructor or withEventName. Used during setup().
 

Additional Inherited Members

- Data Fields inherited from CloudConfigUpdate
unsigned long waitAfterCloudConnectedMs = 2000
 How long to wait after cloud connected to update settings.
 
unsigned long updateTimeoutMs = 60000
 If a response is not received in this amount of time, an error is assumed and another attempt will be made later. More...
 
- Protected Member Functions inherited from CloudConfigUpdate
virtual ~CloudConfigUpdate ()
 Destructor. Base class destructor is empty. Also, you can't delete one of these.
 
 CloudConfigUpdate (const CloudConfigUpdate &)=delete
 This class is not copyable.
 
CloudConfigUpdateoperator= (const CloudConfigUpdate &)=delete
 This class is not copyable.
 

Detailed Description

Update configuration from data retrieved from a webhook.

Two examples that use this are the Devices Notes example and Google Sheets example.

This is derived from CloudConfigUpdateSubscription but is different because it subscribes to a webhook response event, not eventName.

Constructor & Destructor Documentation

◆ CloudConfigUpdateWebhook()

CloudConfigUpdateWebhook::CloudConfigUpdateWebhook ( const char *  eventName)

Constructor with event name.

Parameters
eventNameThe name of the event of the webhook

Note that eventName should be the event name, not the hook-response event that is actually subscribed to.

Member Function Documentation

◆ withEventName()

CloudConfigUpdateWebhook & CloudConfigUpdateWebhook::withEventName ( const char *  eventName)

Method to set the event name to for the webhook.

Parameters
eventNameThe name of the event of the webhook

This must be called before setup(). Calling it later will have no effect.

Note that eventName should be the event name, not the hook-response event that is actually subscribed to.

Field Documentation

◆ requestEventName

String CloudConfigUpdateWebhook::requestEventName
protected

Event name passed to constructor or withEventName. Used during setup().

This is not the hook-response event name!


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