optimize tags for mqtt nesting - #738

This commit is contained in:
proddy
2021-03-11 21:56:45 +01:00
parent 581288b751
commit 1ca905d71a
17 changed files with 262 additions and 242 deletions

View File

@@ -385,7 +385,7 @@ void DallasSensor::publish_values(const bool force) {
char topic[100];
if (dallas_format == Mqtt::Dallas_Format::SENSORID) {
// use '_' as HA doesn't like '-' in the topic name
std::string topicname = sensor.to_string();
std::string topicname = sensor.to_string();
std::replace(topicname.begin(), topicname.end(), '-', '_');
snprintf_P(topic, sizeof(topic), PSTR("homeassistant/sensor/%s/dallas_sensor%s/config"), Mqtt::base().c_str(), topicname);
} else {