|
CloudConfigRK
|
Update configuration from data retrieved from a webhook. More...
#include <CloudConfigRK.h>
Public Member Functions | |
| CloudConfigUpdateWebhook () | |
| Default constructor. | |
| CloudConfigUpdateWebhook (const char *eventName) | |
| Constructor with event name. More... | |
| CloudConfigUpdateWebhook & | withEventName (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... | |
| CloudConfigUpdateSubscription & | withEventName (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. | |
| CloudConfigUpdate & | operator= (const CloudConfigUpdate &)=delete |
| This class is not copyable. | |
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.
| CloudConfigUpdateWebhook::CloudConfigUpdateWebhook | ( | const char * | eventName | ) |
Constructor with event name.
| eventName | The 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.
| CloudConfigUpdateWebhook & CloudConfigUpdateWebhook::withEventName | ( | const char * | eventName | ) |
Method to set the event name to for the webhook.
| eventName | The 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.
|
protected |
Event name passed to constructor or withEventName. Used during setup().
This is not the hook-response event name!
1.8.17