Skip to content

Commit

Permalink
Merge pull request #60 from bobjacobsen/eventid-typos
Browse files Browse the repository at this point in the history
EventID: fix copy&paste from NodeID errors
  • Loading branch information
bobjacobsen authored Jan 21, 2025
2 parents a5f788c + fb6c768 commit c333da9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openlcb/eventid.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __str__(self):
return ("{:02X}.{:02X}.{:02X}.{:02X}.{:02X}.{:02X}.{:02X}.{:02X}"
"".format(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]))

# Convert an integer, list, NodeID or string to a NodeID
# Convert an integer, list, EventID or string to an EventID
def __init__(self, data):
if isinstance(data, int): # create from an integer value
self.eventId = data
Expand All @@ -27,7 +27,7 @@ def __init__(self, data):
result = result*0x100+int(part, 16)
self.eventId = result
elif isinstance(data, EventID):
self.eventId = data.nodeId
self.eventId = data.eventId
elif isinstance(data, list):
self.eventId = 0
if (len(data) > 0):
Expand All @@ -47,7 +47,7 @@ def __init__(self, data):
if (len(data) > 7):
self.eventId |= (data[7] & 0xFF)
else:
print("invalid data type to nodeid constructor", data)
print("invalid data type to EventID constructor", data)

def toArray(self):
return [
Expand Down

0 comments on commit c333da9

Please sign in to comment.