ADD: Track number pf published messages

CLOSES: #28
TIME: 5m
This commit is contained in:
Dominik Meyer 2024-03-01 21:05:38 +01:00
parent 0643b3af38
commit 0f8961d9b6
Signed by: byterazor
GPG Key ID: EABDA0FD5981BC97

View File

@ -247,7 +247,11 @@ sub NTFY_Publish_Msg
return;
}
my $nrPublishedMessages = ReadingsVal($hash->{NAME}, "nrPublishedMessages", 0);
$nrPublishedMessages++;
readingsBeginUpdate($hash);
readingsBulkUpdateIfChanged($hash, "nrPublishedMessages", $nrPublishedMessages);
readingsBulkUpdateIfChanged($hash, "lastUsedTopic", $msg->{topic});
readingsBulkUpdateIfChanged($hash, "lastMessageSend", $msg->{text});
readingsBulkUpdateIfChanged($hash, "lastRawMessage", to_json($message));