From 3de2a53bf508fde0096e06c79884807302d845cb Mon Sep 17 00:00:00 2001 From: Adrian Solom Date: Mon, 3 Apr 2017 13:19:30 +0300 Subject: [PATCH] Fix payload messages type in python3. The change does not affect python2. --- devicehub/devicehub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devicehub/devicehub.py b/devicehub/devicehub.py index 12a29d0..92c0fd1 100755 --- a/devicehub/devicehub.py +++ b/devicehub/devicehub.py @@ -1,4 +1,6 @@ #!/usr/bin/python +from __future__ import print_function + import paho.mqtt.client as mqtt from time import sleep, time from datetime import datetime @@ -407,7 +409,7 @@ def __init__(self, actuator_type, actuator_name): self.callback = None def default_callback(self, *args): - message = args[2].payload + message = args[2].payload.decode() try: payload = json.loads(message)