Commit a57f234a authored by Andrey Filippov's avatar Andrey Filippov

fixed errors in parameters parsing

parent 9cd86c61
...@@ -125,11 +125,11 @@ class X393GPIO(object): ...@@ -125,11 +125,11 @@ class X393GPIO(object):
data = 0 data = 0
for i, e in enumerate (ext): for i, e in enumerate (ext):
if not e is None: if not e is None:
if (e is False) or (e == 0) or (e.upper() == "0") or (e.upper() == "L"): if (e is False) or (e == 0) or (str(e).upper() == "0") or (str(e).upper() == "L"):
data |= 1 << (2*i) data |= 1 << (2*i)
elif (e is True) or (e == 1) or (e.upper() == "1") or (e.upper() == "H"): elif (e is True) or (e == 1) or (str(e).upper() == "1") or (str(e).upper() == "H"):
data |= 2 << (2*i) data |= 2 << (2*i)
elif e.upper() == "I": elif str(e).upper() == "I":
data |= 3 << (2*i) data |= 3 << (2*i)
else: else:
raise Exception ("Expecting one of 'L', 'H', 'I', got "+str(e)+" for ext"+str(i)) raise Exception ("Expecting one of 'L', 'H', 'I', got "+str(e)+" for ext"+str(i))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment