support static topic for non-JSON

This commit is contained in:
John
2022-02-05 18:21:48 +01:00
parent d6fe1fe8ad
commit 29c57a11e5
+2
View File
@@ -1692,6 +1692,8 @@ void MqttHandler::publishMessage(const Message* message, ostringstream* updates,
if (m_staticTopic) {
*updates << "\"circuit\":\"" << message->getCircuit() << "\",\"name\":\"" << message->getName() << "\",\"fields\":{";
}
} else {
*updates << message->getCircuit() << UI_FIELD_SEPARATOR << message->getName() << UI_FIELD_SEPARATOR;
}
result_t result = message->decodeLastData(false, nullptr, -1, outputFormat, updates);
if (result != RESULT_OK) {