@@ -266,7 +266,7 @@ def camel_to_snake(a_string):
266266
267267
268268def detect_supported_devices ():
269- """detect supported devices"""
269+ """detect supported devices based on vendor id """
270270 system = platform .system ()
271271 #print(f'system:{system}')
272272
@@ -285,19 +285,8 @@ def detect_supported_devices():
285285 if re .search (search , lsusb_output , re .MULTILINE ):
286286 #print(f'Found vendor id that matches')
287287 devices = get_devices_with_vendor_id (vid )
288- # check device id
289288 for device in devices :
290- #print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
291- if device .usb_product_id_in_hex :
292- search = f' { vid } :{ device .usb_product_id_in_hex } '
293- #print(f'search:"{search}"')
294- if re .search (search , lsusb_output , re .MULTILINE ):
295- # concatenate the devices with vendor id to possibles
296- possible_devices .add (device )
297- else :
298- # if there is a supported device witout a product id, then it
299- # might be a match... so, concatenate
300- possible_devices .add (device )
289+ possible_devices .add (device )
301290
302291 elif system == "Windows" :
303292 # if windows, run Get-PnpDevice
@@ -313,22 +302,8 @@ def detect_supported_devices():
313302 if re .search (search , sp_output , re .MULTILINE ):
314303 #print(f'Found vendor id that matches')
315304 devices = get_devices_with_vendor_id (vid )
316- # check device id
317305 for device in devices :
318- #print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
319- if device .usb_product_id_in_hex :
320- search = f'DeviceID.*{ vid .upper ()} &PID_{ device .usb_product_id_in_hex .upper ()} '
321- #print(f'search:"{search}"')
322- if re .search (search , sp_output , re .MULTILINE ):
323- # concatenate the devices with vendor id to possibles
324- possible_devices .add (device )
325- # do a check to see if there is a Windows driver issue
326- if detect_windows_needs_driver (device , False ):
327- print ("WARNING: Need to install driver." )
328- else :
329- # if there is a supported device witout a product id, then it
330- # might be a match... so, concatenate
331- possible_devices .add (device )
306+ possible_devices .add (device )
332307
333308 elif system == "Darwin" :
334309 # run: system_profiler SPUSBDataType
@@ -343,19 +318,8 @@ def detect_supported_devices():
343318 if re .search (search , sp_output , re .MULTILINE ):
344319 #print(f'Found vendor id that matches')
345320 devices = get_devices_with_vendor_id (vid )
346- # check device id
347321 for device in devices :
348- #print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
349- if device .usb_product_id_in_hex :
350- search = f'Product ID: 0x{ device .usb_product_id_in_hex } '
351- #print(f'search:"{search}"')
352- if re .search (search , sp_output , re .MULTILINE ):
353- # concatenate the devices with vendor id to possibles
354- possible_devices .add (device )
355- else :
356- # if there is a supported device witout a product id, then it
357- # might be a match... so, concatenate
358- possible_devices .add (device )
322+ possible_devices .add (device )
359323 return possible_devices
360324
361325
0 commit comments