Skip to content

Commit

Permalink
Fix error when creating device list at start
Browse files Browse the repository at this point in the history
  • Loading branch information
berarma committed Aug 26, 2020
1 parent 4e0e760 commit 7d598f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions oversteer/device_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def register_event(self, action, udevice):
def init_device_list(self):
context = pyudev.Context()
for udevice in context.list_devices(subsystem='input', ID_INPUT_JOYSTICK=1):
usb_id = str(udevice.get('ID_VENDOR_ID')) + ':' + str(udevice.get('ID_MODEL_ID'))
if usb_id not in self.supported_wheels:
return
self.update_device_list(udevice)

logging.debug('Devices:' + str(self.devices))
Expand Down

0 comments on commit 7d598f5

Please sign in to comment.