Commit 0d79b9a4 authored by Alessio Netti's avatar Alessio Netti

Merge remote-tracking branch 'remotes/origin/master' into development

parents eaac5b55 db1fb0ce
......@@ -35,7 +35,7 @@ void initLogging() {
//Setup a command line logger
//only print timestamp (without date), severity and message to terminal
auto setupCmdLogger() -> decltype(boost::log::add_console_log()) {
auto logger = boost::log::add_console_log(std::cout,
auto logger = boost::log::add_console_log(std::clog,
boost::log::keywords::format = (boost::log::expressions::stream
<< "[" << boost::log::expressions::format_date_time<boost::posix_time::ptime>("TimeStamp", "%H:%M:%S") << "]"
<< " <" << boost::log::trivial::severity << ">"
......
......@@ -465,11 +465,14 @@ class ConfiguratorTemplateEntity : public ConfiguratorTemplate<SBase, SGroup> {
// Sensor names are adjusted according to the respective MQTT topics
for (auto &g : _sensorGroups) {
for (auto &s : g->acquireSensors()) {
s->setMqtt(MQTTChecker::formatTopic(_mqttPrefix) +
MQTTChecker::formatTopic(g->getEntity()->getMqttPart()) +
MQTTChecker::formatTopic(g->getMqttPart()) +
MQTTChecker::formatTopic(s->getMqtt()));
s->setName(s->getMqtt());
std::string mqtt = MQTTChecker::formatTopic(_mqttPrefix);
if (g->getEntity()) {
mqtt.append(MQTTChecker::formatTopic(g->getEntity()->getMqttPart()));
}
mqtt.append(MQTTChecker::formatTopic(g->getMqttPart()));
mqtt.append(MQTTChecker::formatTopic(s->getMqtt()));
s->setMqtt(mqtt);
s->setName(mqtt);
SensorMetadata *sm = s->getMetadata();
if (sm) {
sm->setPublicName(s->getMqtt());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment