wacom: allow for "no specific requested opcode" where we just return the data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
16c22a95ec
commit
fd02453279
|
@ -503,11 +503,11 @@ class WacomProtocolLowLevelComm(GObject.Object):
|
|||
|
||||
# logger.debug(f'received {data.opcode:02x} / {data.length:02x} / {b2hex(bytes(data))}')
|
||||
|
||||
if not isinstance(expected_opcode, list):
|
||||
expected_opcode = [expected_opcode]
|
||||
|
||||
if data.opcode not in expected_opcode:
|
||||
raise WacomException(f'unexpected opcode: {data.opcode:02x}')
|
||||
if expected_opcode is not None:
|
||||
if not isinstance(expected_opcode, list):
|
||||
expected_opcode = [expected_opcode]
|
||||
if data.opcode not in expected_opcode:
|
||||
raise WacomException(f'unexpected opcode: {data.opcode:02x}')
|
||||
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in New Issue