Skip to content

Commit

Permalink
Query the version as string instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
clssn committed Mar 4, 2024
1 parent 3bc3e29 commit 9fb5735
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/numato_gpio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def __init__(self, device="/dev/ttyACM0"):
self._HEX_DIGITS = self.ports // 4
self._callback = [0] * self.ports
self._edge = [None] * self.ports
self._ver = None
try:
_ = self.id
_ = self.ver
Expand All @@ -129,10 +130,10 @@ def __init__(self, device="/dev/ttyACM0"):

@property
def ver(self):
"""Return the device's version number as an integer value."""
if not hasattr(self, "_ver"):
"""Return the device's version string."""
if self._ver is None:
with self._rw_lock:
self._ver = self._read_int("ver", 32)
self._ver = self._query_string(f"ver")
return self._ver

@property
Expand Down

0 comments on commit 9fb5735

Please sign in to comment.