From ab373501355c139ad5ee230e145a03b05d871d06 Mon Sep 17 00:00:00 2001 From: Softwarecrash Date: Wed, 8 Nov 2023 16:42:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20HA=20Discovery=20retain=20?= =?UTF-8?q?flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformio.ini | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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]);