skip seen for active write messages and publish read pendant for those
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
# - "$" matches the end of the input, e.g. "al$" matches "hal" but not "all".
|
||||
# - "*" matches a single arbitrary length wildcard part in the middle, e.g. "^a*l$" matches "all" but not "always".
|
||||
|
||||
# include only messages having data sent at least once.
|
||||
# include only messages having data sent at least once (only checked for passive or read messages, not for active write).
|
||||
# HA integration: filtering only seen messages to avoid unnecessary "pollution"
|
||||
filter-seen = 1
|
||||
# include only messages having a priority less than or equal to the specified value.
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
# - "$" matches the end of the input, e.g. "al$" matches "hal" but not "all".
|
||||
# - "*" matches a single arbitrary length wildcard part in the middle, e.g. "^a*l$" matches "all" but not "always".
|
||||
|
||||
# include only messages having data sent at least once.
|
||||
# include only messages having data sent at least once (only checked for passive or read messages, not for active write).
|
||||
filter-seen = 1
|
||||
# include only messages having a priority less than or equal to the specified value.
|
||||
#filter-priority =
|
||||
|
||||
@@ -1274,7 +1274,10 @@ void MqttHandler::run() {
|
||||
for (const auto& message : messages) {
|
||||
if (filterSeen) {
|
||||
if (message->getLastUpdateTime()==0) {
|
||||
continue; // no data ever
|
||||
if (message->isPassive() || !message->isWrite()) {
|
||||
// only wait for data on passive or read messages
|
||||
continue; // no data ever
|
||||
}
|
||||
}
|
||||
if (message->getDataHandlerState()==1) {
|
||||
// already seen in the past, check for poll prio update
|
||||
@@ -1425,6 +1428,12 @@ void MqttHandler::run() {
|
||||
if (filterSeen && message->getLastUpdateTime()>message->getCreateTime()) {
|
||||
// ensure data is published as well
|
||||
m_updatedMessages[message->getKey()]++;
|
||||
} else if (filterSeen && direction=="w") {
|
||||
// publish data for read pendant of write message
|
||||
Message* read = m_messages->find(message->getCircuit(), message->getName(), "", true);
|
||||
if (read && read->getLastUpdateTime()>0) {
|
||||
m_updatedMessages[read->getKey()]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
time(&m_definitionsSince);
|
||||
|
||||
Reference in New Issue
Block a user