d1_mini_pro-sensor-mqtt/lib/HomeAssistantDevices/HAControllableDevice.hpp

18 lines
441 B
C++
Raw Normal View History

#pragma once
#include <HADevice.hpp>
class HAControllableDevice : public HADevice {
protected:
char *command_topic;
unsigned int command_topic_size;
void setupCommandTopic();
public:
HAControllableDevice(PubSubClient &client, const char *device_type,
const char *name, const char *unique_id);
void subscribeToCommandTopic();
virtual void handle(char *topic, byte *payload, unsigned int length) = 0;
};