From 86a60db8cdea2af4a7360f26eaab156866ba1817 Mon Sep 17 00:00:00 2001 From: Mountain-Eagle Date: Mon, 29 Aug 2022 06:25:39 +1000 Subject: [PATCH] Delete HAMqttDevice.h --- HAMqttDevice.h | 77 -------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 HAMqttDevice.h diff --git a/HAMqttDevice.h b/HAMqttDevice.h deleted file mode 100644 index 370494a..0000000 --- a/HAMqttDevice.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef HA_MQTT_DEVICE_H -#define HA_MQTT_DEVICE_H - -#include "Arduino.h" - -class HAMqttDevice -{ -public: - enum DeviceType - { - ALARM_CONTROL_PANEL, - BINARY_SENSOR, - CAMERA, - COVER, - FAN, - LIGHT, - LOCK, - SENSOR, - SWITCH, - CLIMATE, - VACUUM - }; - -private: - // Device proprieties - const String _name; - const DeviceType _type; - - String _identifier; - String _topic; - - // Config variables handling - struct ConfigVar - { - String key; - String value; - }; - std::vector _configVars; - - // Device attributes handling - struct Attribute - { - String key; - String value; - }; - std::vector _attributes; - -public: - HAMqttDevice( - const String &name, - const DeviceType type, - const String &haMQTTPrefix = "homeassistant"); - - ~HAMqttDevice(); - - HAMqttDevice &enableCommandTopic(); - HAMqttDevice &enableStateTopic(); - HAMqttDevice &enableAttributesTopic(); - - HAMqttDevice &addConfigVar(const String &key, const String &value); - HAMqttDevice &addAttribute(const String &key, const String &value); - HAMqttDevice &clearAttributes(); - - const String getConfigPayload() const; - const String getAttributesPayload() const; - - inline const String getTopic() const { return _topic; } - inline const String getStateTopic() const { return _topic + "/state"; } - inline const String getConfigTopic() const { return _topic + "/config"; } - inline const String getAttributesTopic() const { return _topic + "/attr"; } - inline const String getCommandTopic() const { return _topic + "/cmd"; } - -private: - static String deviceTypeToStr(DeviceType type); -}; - -#endif \ No newline at end of file