use readable message counter part only for writable message with multiple fields in definition topic if integration does not combine them
This commit is contained in:
@@ -838,11 +838,21 @@ void MqttHandler::run() {
|
|||||||
if (filterPriority > 0 && (message->getPollPriority() == 0 || message->getPollPriority() > filterPriority)) {
|
if (filterPriority > 0 && (message->getPollPriority() == 0 || message->getPollPriority() > filterPriority)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (includeActiveWrite && !message->isWrite()) {
|
if (includeActiveWrite) {
|
||||||
// check for existance of write message with same name
|
if (message->isWrite()) {
|
||||||
Message* write = m_messages->find(message->getCircuit(), message->getName(), "", true);
|
bool skipMultiFieldWrite = (!m_hasDefinitionFieldsPayload || m_publishByField) && !message->isPassive() && message->getFieldCount() > 1;
|
||||||
if (write) {
|
if (skipMultiFieldWrite) {
|
||||||
continue; // avoid sending definition of read AND write message with the same key
|
continue; // multi-field message is not writable when publishing by field or combining multiple fields in one definition, so skip it
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// check for existance of write message with same name
|
||||||
|
Message* write = m_messages->find(message->getCircuit(), message->getName(), "", true);
|
||||||
|
if (write) {
|
||||||
|
bool skipMultiFieldWrite = (!m_hasDefinitionFieldsPayload || m_publishByField) && write->getFieldCount() > 1;
|
||||||
|
if (!skipMultiFieldWrite) {
|
||||||
|
continue; // avoid sending definition of read AND write message with the same key
|
||||||
|
} // else: multi-field write message is not writable when publishing by field or combining multiple fields in one definition, so skip it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StringReplacers msgValues = m_replacers; // need a copy here as the contents are manipulated
|
StringReplacers msgValues = m_replacers; // need a copy here as the contents are manipulated
|
||||||
|
|||||||
Reference in New Issue
Block a user