Skip to content

Commit

Permalink
Fix forbidden + sign in publish topic
Browse files Browse the repository at this point in the history
  • Loading branch information
Domochip committed Jan 29, 2022
1 parent e3f6d08 commit 985e7b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/WirelessTeleInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,11 @@ void WebTeleInfo::publishTick(bool publishAll = true)
//copy completeTopic in order to "complete" it ...
String thisLabelTopic = completeTopic;

String name(me->name);
name.replace(F("+"), F("plus")); // avoid fobidden '+' sign in topic (NJOURF+1 & PJOURF+1)

//add the label name
thisLabelTopic += (char *)me->name;
thisLabelTopic += name;

//send
_haSendResult = _mqttMan.publish(thisLabelTopic.c_str(), me->value);
Expand Down

0 comments on commit 985e7b6

Please sign in to comment.