diff --git a/Config.h b/Config.h index 4a26369..d7b7e8a 100644 --- a/Config.h +++ b/Config.h @@ -1,6 +1,6 @@ #pragma once -#define NUKI_HUB_VERSION "8.24-pre-1" +#define NUKI_HUB_VERSION "8.24-pre-3" #define MQTT_QOS_LEVEL 1 #define MQTT_CLEAN_SESSIONS false diff --git a/Network.cpp b/Network.cpp index 85598d1..0e4cbbe 100644 --- a/Network.cpp +++ b/Network.cpp @@ -521,10 +521,11 @@ void Network::initTopic(const char *prefix, const char *path, const char *value) void Network::buildMqttPath(char* outPath, std::initializer_list paths) { int offset = 0; + int pathCount = 0; for(const char* path : paths) { - if(path[0] != '/') + if(pathCount > 0 && path[0] != '/') { outPath[offset] = '/'; ++offset; @@ -537,6 +538,7 @@ void Network::buildMqttPath(char* outPath, std::initializer_list pa ++offset; ++i; } + ++pathCount; } outPath[offset] = 0x00;