Skip to content

Commit

Permalink
🐛 Fix HA Discovery retain flag
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarecrash committed Nov 8, 2023
1 parent 7fbd88c commit ab37350
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>().c_str(), jsonESP["IP"].as<String>().c_str(), _settings.data.deviceName, Json["Model_description"].as<String>().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]);
Expand Down

0 comments on commit ab37350

Please sign in to comment.