Skip to content

Commit

Permalink
python: Avoid exception when getting FW version
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Feb 12, 2024
1 parent 8edaeec commit 13efc56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/inputmodule/inputmodule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def get_brightness(dev):
def get_version(dev):
"""Get the device's firmware version"""
res = send_command(dev, CommandVals.Version, with_response=True)
if not res:
return 'Unknown'
major = res[0]
minor = (res[1] & 0xF0) >> 4
patch = res[1] & 0xF
Expand Down

0 comments on commit 13efc56

Please sign in to comment.