mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
add v3.4 entity id flag to MQTT settings
This commit is contained in:
@@ -155,6 +155,7 @@ void MqttSettings::read(MqttSettings & settings, JsonObject & root) {
|
||||
root["keep_alive"] = settings.keepAlive;
|
||||
root["clean_session"] = settings.cleanSession;
|
||||
root["multiple_instances"] = settings.multiple_instances;
|
||||
root["entity_fullname"] = settings.entity_fullname;
|
||||
|
||||
// added by proddy for EMS-ESP
|
||||
root["publish_time_boiler"] = settings.publish_time_boiler;
|
||||
@@ -188,9 +189,9 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting
|
||||
newSettings.keepAlive = root["keep_alive"] | FACTORY_MQTT_KEEP_ALIVE;
|
||||
newSettings.cleanSession = root["clean_session"] | FACTORY_MQTT_CLEAN_SESSION;
|
||||
newSettings.multiple_instances = root["multiple_instances"] | FACTORY_MQTT_MULTIPLE_INSTANCES;
|
||||
|
||||
newSettings.mqtt_qos = root["mqtt_qos"] | EMSESP_DEFAULT_MQTT_QOS;
|
||||
newSettings.mqtt_retain = root["mqtt_retain"] | EMSESP_DEFAULT_MQTT_RETAIN;
|
||||
newSettings.entity_fullname = root["entity_fullname"] | FACTORY_MQTT_ENTITY_FULLNAME;
|
||||
newSettings.mqtt_qos = root["mqtt_qos"] | EMSESP_DEFAULT_MQTT_QOS;
|
||||
newSettings.mqtt_retain = root["mqtt_retain"] | EMSESP_DEFAULT_MQTT_RETAIN;
|
||||
|
||||
newSettings.publish_time_boiler = root["publish_time_boiler"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
newSettings.publish_time_thermostat = root["publish_time_thermostat"] | EMSESP_DEFAULT_PUBLISH_TIME;
|
||||
|
||||
@@ -61,6 +61,10 @@ static String generateClientId() {
|
||||
#define FACTORY_MQTT_MULTIPLE_INSTANCES false
|
||||
#endif
|
||||
|
||||
#ifndef FACTORY_MQTT_ENTITY_FULLNAME
|
||||
#define FACTORY_MQTT_ENTITY_FULLNAME false
|
||||
#endif
|
||||
|
||||
class MqttSettings {
|
||||
public:
|
||||
// host and port - if enabled
|
||||
@@ -82,6 +86,9 @@ class MqttSettings {
|
||||
// multiple instances
|
||||
bool multiple_instances;
|
||||
|
||||
// use v3.4 entity fullnames in Discovery
|
||||
bool entity_fullname;
|
||||
|
||||
// proddy EMS-ESP specific
|
||||
String base;
|
||||
uint16_t publish_time_boiler;
|
||||
|
||||
Reference in New Issue
Block a user