filter message defs by users levels as well
This commit is contained in:
@@ -101,6 +101,7 @@ filter-seen = 1
|
|||||||
# HA integration: filter to some useful names for monitoring the heating circuit
|
# HA integration: filter to some useful names for monitoring the heating circuit
|
||||||
filter-name = status|temp|yield|count|energy|power|runtime|hours|starts|mode|curve|^load$|^party$
|
filter-name = status|temp|yield|count|energy|power|runtime|hours|starts|mode|curve|^load$|^party$
|
||||||
# include only messages having the specified level (partial match, alternatives and wildcard supported).
|
# include only messages having the specified level (partial match, alternatives and wildcard supported).
|
||||||
|
# Note: This is a filter on top of the messages already filtered implicitly for the ebusd "mqtt" user (if any).
|
||||||
# Note: Since the empty string matches all levels, an explicit check for empty string (with "^$") needs to be used for
|
# Note: Since the empty string matches all levels, an explicit check for empty string (with "^$") needs to be used for
|
||||||
# including only messages without a level.
|
# including only messages without a level.
|
||||||
filter-level = ^$
|
filter-level = ^$
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ filter-seen = 1
|
|||||||
# include only messages having the specified name (partial match, alternatives and wildcard supported).
|
# include only messages having the specified name (partial match, alternatives and wildcard supported).
|
||||||
#filter-name =
|
#filter-name =
|
||||||
# include only messages having the specified level (partial match, alternatives and wildcard supported).
|
# include only messages having the specified level (partial match, alternatives and wildcard supported).
|
||||||
|
# Note: This is a filter on top of the messages already filtered implicitly for the ebusd "mqtt" user (if any).
|
||||||
# Note: Since the empty string matches all levels, an explicit check for empty string (with "^$") needs to be used for
|
# Note: Since the empty string matches all levels, an explicit check for empty string (with "^$") needs to be used for
|
||||||
# including only messages without a level.
|
# including only messages without a level.
|
||||||
filter-level = ^$
|
filter-level = ^$
|
||||||
|
|||||||
@@ -1353,7 +1353,7 @@ void MqttHandler::run() {
|
|||||||
if (m_connected && m_hasDefinitionTopic) {
|
if (m_connected && m_hasDefinitionTopic) {
|
||||||
ostringstream ostr;
|
ostringstream ostr;
|
||||||
deque<Message*> messages;
|
deque<Message*> messages;
|
||||||
m_messages->findAll("", "", "", false, true, true, true, true, true, 0, 0, false, &messages);
|
m_messages->findAll("", "", m_levels, false, true, true, true, true, true, 0, 0, false, &messages);
|
||||||
for (const auto& message : messages) {
|
for (const auto& message : messages) {
|
||||||
if (filterSeen) {
|
if (filterSeen) {
|
||||||
if (message->getLastUpdateTime()==0) {
|
if (message->getLastUpdateTime()==0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user