base: allow for a None vendor ID

Unsure how to trigger this case but I have all my devices (not recently
connected) with a vendor ID of None.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-19 13:25:29 +10:00 committed by Benjamin Tissoires
parent 8d67bbf5c4
commit be9b3c02cc
1 changed files with 5 additions and 2 deletions

View File

@ -362,8 +362,9 @@ class Tuhi(GObject.Object):
# We have a reverse-engineered protocol. Let's not talk to anyone
# who doesn't look like we know them to avoid potentially bricking a
# device.
if bluez_device.vendor_id not in WACOM_COMPANY_IDS:
# device. If the vendor id is None it may still be one of our
# devices, provided it's been registered previously.
if bluez_device.vendor_id is not None and bluez_device.vendor_id not in WACOM_COMPANY_IDS:
return
# check if the device is already known to us
@ -371,6 +372,8 @@ class Tuhi(GObject.Object):
config = self.config.devices[bluez_device.address]
uuid = config['uuid']
except KeyError:
if bluez_device.vendor_id is None:
return
uuid = None
# if we got here from a currently live BlueZ device,