Workaround for Spark register problems

This is a workaround for registering problems with Spark.
The registration hangs at "Connecting to device...".

Internally the `GENERAL_ERROR` occurs, which is expected
when registering a Spark device, but this should also
raise an AuthorizeException, but it instead reaches the
handler as DeviceError.

It is currently unclear why the `GENERAL_ERROR` passes to
this handler, so this catches any `GENERAL_ERROR` while
registering a Spark device.
pull/240/head
Niclas Hoyer 2020-01-02 20:59:04 +01:00 committed by Peter Hutterer
parent 820f168f43
commit a0566e0dc0
1 changed files with 7 additions and 0 deletions

View File

@ -423,6 +423,13 @@ class WacomRegisterHelper(WacomProtocolLowLevelComm):
except AuthorizationError:
# this is expected
pass
except Exception as e:
logger.exception('Got other Exception while registering Spark device')
if e.errorcode == DeviceError.ErrorCode.GENERAL_ERROR:
logger.debug('Got GENERAL_ERROR while registering Spark device')
pass
else:
raise
# The "press button now command" on the spark
self.p.execute(Interactions.REGISTER_PRESS_BUTTON)