diff --git a/include/ha.h b/include/ha.h index 4490d96..c577006 100644 --- a/include/ha.h +++ b/include/ha.h @@ -32,11 +32,12 @@ namespace Ha { } }; + typedef void (*onMessage)(const char* msg); struct Command : Component { const char* commandTopic; - void (*f)(const char* msg); + onMessage f; - Command(const char* name, const char* uniqueId, const char* configTopic, const char* commandTopic, void (*f)(const char* msg)) : Component(name, uniqueId, configTopic) { + Command(const char* name, const char* uniqueId, const char* configTopic, const char* commandTopic, onMessage f) : Component(name, uniqueId, configTopic) { this->commandTopic = commandTopic; this->f = f; }