Skip to content

Commit

Permalink
[SYS] Add automaticaly / at the end of root topic if not present (#1772)
Browse files Browse the repository at this point in the history
To avoid concatenation with the gateway name and a non working auto discovery
  • Loading branch information
1technophile authored Oct 12, 2023
1 parent 45bd18b commit c6394b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,10 @@ void setup_wifimanager(bool reset_settings) {
strcpy(mqtt_user, custom_mqtt_user.getValue());
strcpy(mqtt_pass, custom_mqtt_pass.getValue());
strcpy(mqtt_topic, custom_mqtt_topic.getValue());
if (mqtt_topic[strlen(mqtt_topic) - 1] != '/' && strlen(mqtt_topic) < parameters_size + 1) {
strcat(mqtt_topic, "/");
}

strcpy(gateway_name, custom_gateway_name.getValue());
strcpy(ota_pass, custom_ota_pass.getValue());
mqtt_secure = *custom_mqtt_secure.getValue();
Expand Down

0 comments on commit c6394b2

Please sign in to comment.