add HA device_class

This commit is contained in:
Proddy
2021-10-12 12:58:29 +02:00
parent 676268d7af
commit 50befd8991
2 changed files with 58 additions and 19 deletions

View File

@@ -96,6 +96,10 @@ class Mqtt {
};
// for Home Assistant
enum class State_class { NONE, MEASUREMENT, TOTAL_INCREASING };
enum class Device_class { NONE, TEMPERATURE, POWER_FACTOR, ENERGY, PRESSURE, POWER, SIGNAL_STRENGTH };
static constexpr uint8_t MQTT_TOPIC_MAX_SIZE = 128; // note this should really match the user setting in mqttSettings.maxTopicLength
static void on_connect();