mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
refactor device value rendering (to Web, Console or MQTT) to base class #632
This commit is contained in:
@@ -60,9 +60,11 @@ static String generateClientId() {
|
||||
#define FACTORY_MQTT_MAX_TOPIC_LENGTH 128
|
||||
#endif
|
||||
|
||||
#define EMSESP_DEFAULT_MQTT_FORMAT 2 // nested
|
||||
#define EMSESP_DEFAULT_DALLAS_FORMAT 1 // sensorid
|
||||
#define EMSESP_DEFAULT_HA_CLIMATE_FORMAT 1 // current temp
|
||||
#define EMSESP_DEFAULT_MQTT_QOS 0
|
||||
#define EMSESP_DEFAULT_MQTT_RETAIN false
|
||||
#define EMSESP_DEFAULT_HA_ENABLED false
|
||||
#define EMSESP_DEFAULT_PUBLISH_TIME 10
|
||||
|
||||
class MqttSettings {
|
||||
@@ -91,9 +93,11 @@ class MqttSettings {
|
||||
uint16_t publish_time_mixer;
|
||||
uint16_t publish_time_other;
|
||||
uint16_t publish_time_sensor;
|
||||
uint8_t mqtt_format; // 1=single, 2=nested, 3=ha, 4=custom
|
||||
uint8_t mqtt_qos;
|
||||
bool mqtt_retain;
|
||||
uint8_t dallas_format;
|
||||
uint8_t ha_climate_format;
|
||||
bool ha_enabled;
|
||||
|
||||
static void read(MqttSettings & settings, JsonObject & root);
|
||||
static StateUpdateResult update(JsonObject & root, MqttSettings & settings);
|
||||
|
||||
Reference in New Issue
Block a user