From e17873c648a29a71b8bdf46c039f2c932f886b0e Mon Sep 17 00:00:00 2001 From: Shy Date: Sun, 12 Mar 2017 15:49:12 +0100 Subject: [PATCH] Added support for tuples in C4Interface --- c4ctrl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/c4ctrl.py b/c4ctrl.py index cb1f505..80b3948 100755 --- a/c4ctrl.py +++ b/c4ctrl.py @@ -30,7 +30,14 @@ class C4Interface(): if type(item) == dict: item["qos"] = self.qos item["retain"] = self.retain - + elif type(item) == tuple: + item = ( + item[0] or self.topic, # topic + item[1], # payload + self.qos, # qos + self.retain # retain + ) + if self.debug: return print("[DEBUG] inhibited messages:", cmd) print(cmd)