diff --git a/relay.py b/relay.py index f04828e..8612994 100755 --- a/relay.py +++ b/relay.py @@ -70,7 +70,8 @@ def init_serial(pPort): init_serial(device) if action != 'status': for relay in relays: - ser.write(relay.encode('ascii')+action+'\r\n') + command = relay+action+'\r\n' + ser.write(command.encode('ascii')) bytes = ser.readline() #print ('Renvoie :\r\n' + bytes)