Cleanup python3 support
parent
412c3192cb
commit
cd715e884c
|
@ -37,7 +37,7 @@ class SpejsIoTClient(mqtt.Client):
|
|||
if node in self.endpoints:
|
||||
self.logger.info('Passing to %r', self.endpoints[node])
|
||||
try:
|
||||
self.endpoints[node].process(attrib, msg.payload)
|
||||
self.endpoints[node].process(attrib, msg.payload.decode())
|
||||
except Exception:
|
||||
self.logger.exception('Error occured')
|
||||
|
||||
|
@ -53,7 +53,7 @@ class SpejsIoTClient(mqtt.Client):
|
|||
def notify(self, node, attribute, value, retain=True):
|
||||
if type(value) in [int, float, bool]:
|
||||
value = str(value).lower()
|
||||
elif type(value) not in [str, unicode]:
|
||||
elif type(value) not in [str, bytes]:
|
||||
value = str(value)
|
||||
|
||||
self.publish('{}{}/{}'.format(self.topic_prefix, node, attribute), value, retain=retain)
|
||||
|
|
Loading…
Reference in New Issue