diff --git a/platformio.ini b/platformio.ini index e875f0a..c1fb45b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,7 +18,7 @@ monitor_filters = esp8266_exception_decoder, default, time, printable, colorize board_build.ldscript = eagle.flash.4m.ld ; 4MB (FS:4MB OTA:~3600KB) upload_speed = 921600 -custom_prog_version = 1.1.1SR4 +custom_prog_version = 1.1.1 build_flags = -DVERSION=${this.custom_prog_version} diff --git a/src/main.cpp b/src/main.cpp index 7c93eec..a63141f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -718,7 +718,7 @@ bool sendHaDiscovery() mqttContentLength = sprintf(configBuff, "{\"state_topic\": \"%s/%s\",\"unique_id\": \"sensor.%s_%s\",\"name\": \"%s\",\"icon\": \"%s\",\"unit_of_measurement\": \"%s\",\"device_class\":\"%s\",\"device\":{\"identifiers\":[\"%s\"], \"configuration_url\":\"http://%s\",\"name\":\"%s\", \"model\":\"%s\",\"manufacturer\":\"SoftWareCrash\",\"sw_version\":\"Victron2MQTT %s\"}}", _settings.data.mqttTopic, haDescriptor[i][0], _settings.data.deviceName, haDescriptor[i][0], haDescriptor[i][0], haDescriptor[i][1], haDescriptor[i][2], haDescriptor[i][3], Json["Serial_number"].as().c_str(), jsonESP["IP"].as().c_str(), _settings.data.deviceName, Json["Model_description"].as().c_str(), SOFTWARE_VERSION); - mqttclient.beginPublish(topBuff, mqttContentLength, false); + mqttclient.beginPublish(topBuff, mqttContentLength, true); for (size_t i = 0; i < mqttContentLength; i++) { mqttclient.write(configBuff[i]);