From 779a907ebd2a15611d03f687b517415a4afed78d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 20 Feb 2018 20:41:56 +0100 Subject: [PATCH] Made the ZeroBorg module Python3-friendly --- platypush/plugins/gpio/zeroborg.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platypush/plugins/gpio/zeroborg.py b/platypush/plugins/gpio/zeroborg.py index f3fd315ba..326d0fa29 100755 --- a/platypush/plugins/gpio/zeroborg.py +++ b/platypush/plugins/gpio/zeroborg.py @@ -217,9 +217,8 @@ Command codes can be found at the top of ZeroBorg.py, data is a list of 0 or mor Under most circumstances you should use the appropriate function instead of RawWrite """ - rawOutput = chr(command) - for singleByte in data: - rawOutput += chr(singleByte) + rawOutput = bytes([command]) + if data: rawOutput += bytes(data) self.i2cWrite.write(rawOutput) @@ -240,7 +239,7 @@ Under most circumstances you should use the appropriate function instead of RawR rawReply = self.i2cRead.read(length) reply = [] for singleByte in rawReply: - reply.append(ord(singleByte)) + reply.append(singleByte) if command == reply[0]: break else: