Skip to content

Commit 13efc56

Browse files
committed
python: Avoid exception when getting FW version
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 8edaeec commit 13efc56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/inputmodule/inputmodule/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ def get_brightness(dev):
109109
def get_version(dev):
110110
"""Get the device's firmware version"""
111111
res = send_command(dev, CommandVals.Version, with_response=True)
112+
if not res:
113+
return 'Unknown'
112114
major = res[0]
113115
minor = (res[1] & 0xF0) >> 4
114116
patch = res[1] & 0xF

0 commit comments

Comments
 (0)