skip retained messages
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 22 Mar 2021 18:04:45 +0000 (19:04 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 22 Mar 2021 18:06:57 +0000 (19:06 +0100)
zc-mqtt

diff --git a/zc-mqtt b/zc-mqtt
index 690010e..5060b8d 100755 (executable)
--- a/zc-mqtt
+++ b/zc-mqtt
@@ -117,6 +117,9 @@ while (1) {
         print $msg->string, "\n";
       }
 
+      # skip retained
+      next if $msg->string =~ m{Publish/at-most-once,retain};
+
        my $topic = $msg->topic;
        # Inclinometer/ZCT330Ex_SWP_N_YK/869858031634109/up
        my $dir = $topic; # leave imei in dir