Delete HAMqttDevice.h

This commit is contained in:
Mountain-Eagle 2022-08-29 06:25:39 +10:00 committed by GitHub
parent 1256b4136f
commit 86a60db8cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 77 deletions

View File

@ -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<ConfigVar> _configVars;
// Device attributes handling
struct Attribute
{
String key;
String value;
};
std::vector<Attribute> _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