From 09228e511a23717c7317df362b42888d8dcd15c0 Mon Sep 17 00:00:00 2001 From: wallarelvo Date: Fri, 5 Feb 2016 16:59:55 -0500 Subject: [PATCH] Add easy example to show how to set the binary indicator on --- src/client/connection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/connection.py b/src/client/connection.py index 3152658..697a080 100644 --- a/src/client/connection.py +++ b/src/client/connection.py @@ -22,9 +22,9 @@ def onMessage(self, payload, is_binary): MMClient.updates[data["topic"]] = data @staticmethod - def send_message(payload): + def send_message(payload, is_binary): if not MMClient.client is None: - MMClient.client.sendMessage(payload) + MMClient.client.sendMessage(payload, is_binary) class Connection(threading.Thread): @@ -47,7 +47,8 @@ def stop(self): def send_message(self, data): payload = json.dumps(data) - return MMClient.send_message(payload) + is_binary = False + return MMClient.send_message(payload, is_binary) def updates(self): payloads = copy.copy(MMClient.updates)