EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
#include <haTrigger.h>
Public Member Functions | |
HATrigger () | |
Trigger constructor. More... | |
void | setPayload (const char *payload) |
Optional payload to match the payload being sent over the topic https://www.home-assistant.io/integrations/device_trigger.mqtt/#payload. More... | |
void | setType (ha_triggerType_t type) |
Set trigger type as ha_triggerType_t https://www.home-assistant.io/integrations/device_trigger.mqtt/#type. More... | |
void | setType (const char *type) |
Set trigger type as char string https://www.home-assistant.io/integrations/device_trigger.mqtt/#type. More... | |
void | setSubtype (ha_triggerSubtype_t subtype) |
Set trigger subtype as ha_triggerSubtype_t https://www.home-assistant.io/integrations/device_trigger.mqtt/#subtype. More... | |
void | setSubtype (const char *subtype) |
Set trigger subtype as char string https://www.home-assistant.io/integrations/device_trigger.mqtt/#subtype. More... | |
Public Member Functions inherited from HAEntity | |
size_t | getAnounceMessage (int bufferlen, uint8_t *buffer) |
Gets entity anounce message to be sent over EnigmaIOT message. More... | |
void | setNameSufix (const char *payload) |
Sets name suffix. Used for multi entity nodes. More... | |
void | allowSendAttributes () |
Enables registering entity attributes as a json object. More... | |
size_t | measureMessage () |
Gets needed buffer size for discovery message. More... | |
Static Public Member Functions | |
static const char * | getTriggerTypeStr (int type) |
Returns string that correspond with trigger type in ha_triggerType_t format https://www.home-assistant.io/integrations/device_trigger.mqtt/#type. More... | |
static const char * | getTriggerSubtypeStr (int subtype) |
Returns string that correspond with trigger subtype in ha_triggerSubtype_t format https://www.home-assistant.io/integrations/device_trigger.mqtt/#subtype. More... | |
static size_t | getDiscoveryJson (char *buffer, size_t buflen, const char *nodeName, const char *networkName, DynamicJsonDocument *inputJSON) |
Allows Gateway to get Home Assistant discovery message using Trigger template. More... | |
Static Public Member Functions inherited from HAEntity | |
static String | deviceTypeStr (haDeviceType_t entityType) |
Gets entity type string from haDeviceType_t value https://www.home-assistant.io/docs/mqtt/discovery/. More... | |
static String | getDiscoveryTopic (const char *hassPrefix, const char *nodeName, haDeviceType_t entityType, const char *nameSuffix=NULL) |
Allows Gateway to get discovery message MQTT topic. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from HAEntity | |
HAEntity () | |
Default constructor. Needed for inheritance. More... | |
Protected Attributes inherited from HAEntity | |
size_t | capacity |
JSON object memory reservation length. More... | |
haDeviceType_t | deviceType = UNDEFINED |
HomeAssistant entity device type. More... | |
DynamicJsonDocument * | entityConfig |
JSON object to be sent to gateway. More... | |
Definition at line 126 of file haTrigger.h.
|
inline |
Trigger constructor.
Definition at line 132 of file haTrigger.h.
|
static |
Allows Gateway to get Home Assistant discovery message using Trigger template.
buffer | Buffer to hold message string |
buflen | Buffer size |
nodeName | Originating node name |
networkName | EnigmaIOT network name |
inputJSON | JSON object sent by node with needed data to fill template in |
msgPack || !len
Definition at line 39 of file haTrigger.cpp.
|
inlinestatic |
Returns string that correspond with trigger subtype in ha_triggerSubtype_t format https://www.home-assistant.io/integrations/device_trigger.mqtt/#subtype.
subtype | Trigger type |
Definition at line 158 of file haTrigger.h.
|
inlinestatic |
Returns string that correspond with trigger type in ha_triggerType_t format https://www.home-assistant.io/integrations/device_trigger.mqtt/#type.
type | Trigger type |
Definition at line 145 of file haTrigger.h.
void HATrigger::setPayload | ( | const char * | payload | ) |
Optional payload to match the payload being sent over the topic https://www.home-assistant.io/integrations/device_trigger.mqtt/#payload.
payload | Payload string |
Definition at line 13 of file haTrigger.cpp.
|
inline |
Set trigger subtype as char string https://www.home-assistant.io/integrations/device_trigger.mqtt/#subtype.
subtype | Payload string |
Definition at line 205 of file haTrigger.h.
|
inline |
Set trigger subtype as ha_triggerSubtype_t https://www.home-assistant.io/integrations/device_trigger.mqtt/#subtype.
subtype | Payload string |
Definition at line 196 of file haTrigger.h.
|
inline |
Set trigger type as char string https://www.home-assistant.io/integrations/device_trigger.mqtt/#type.
type | Payload string |
Definition at line 187 of file haTrigger.h.
|
inline |
Set trigger type as ha_triggerType_t https://www.home-assistant.io/integrations/device_trigger.mqtt/#type.
type | Payload string |
Definition at line 178 of file haTrigger.h.