Cleanup python3 support

master
informatic 2019-04-20 14:26:06 +02:00
parent 412c3192cb
commit cd715e884c
1 changed files with 2 additions and 2 deletions

View File

@ -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)