fix device detection

This commit is contained in:
Chrys 2020-04-11 01:19:52 +02:00
parent 5b5536444d
commit fd63321554

View File

@ -71,18 +71,21 @@ class driver(inputDriver):
while device: while device:
self.env['runtime']['debug'].writeDebugOut('plugInputDeviceWatchdogUdev:' + str(device), debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('plugInputDeviceWatchdogUdev:' + str(device), debug.debugLevel.INFO)
try: try:
if currDevice.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']: try:
ignorePlug = True if device.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
if currDevice.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']: ignorePlug = True
ignorePlug = True if device.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
if 'BRLTTY' in currDevice.name.upper(): ignorePlug = True
ignorePlug = True if 'BRLTTY' in device.name.upper():
ignorePlug = True
except Exception as e:
self.env['runtime']['debug'].writeDebugOut("plugInputDeviceWatchdogUdev CHECK NAME CRASH: " + str(e),debug.debugLevel.ERROR)
if not ignorePlug: if not ignorePlug:
virtual = '/sys/devices/virtual/input/' in device.sys_path virtual = '/sys/devices/virtual/input/' in device.sys_path
if device.device_node: if device.device_node:
validDevices.append({'device': device.device_node, 'virtual': virtual}) validDevices.append({'device': device.device_node, 'virtual': virtual})
except: except Exception as e:
pass self.env['runtime']['debug'].writeDebugOut("plugInputDeviceWatchdogUdev APPEND CRASH: " + str(e),debug.debugLevel.ERROR)
try: try:
pollTimeout = 1 pollTimeout = 1
device = monitor.poll(pollTimeout) device = monitor.poll(pollTimeout)