Skip to content

Commit

Permalink
Add easy example to show how to set the binary indicator on
Browse files Browse the repository at this point in the history
  • Loading branch information
a20r committed Feb 5, 2016
1 parent 522b71d commit 09228e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit 09228e5

Please sign in to comment.