Skip to content

Commit b59b379

Browse files
Cleared the code a bit
1 parent 0e56b8c commit b59b379

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pyusb2fir/usb2fir.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import usb1
2121

2222
USB2FIR_VID = 0x04D8
23-
USB2FIR_PID = [0xEE7D, 0x003C]
23+
USB2FIR_PID = 0xEE7D
2424

2525
CMD_GET_CAPABILITY = 0
2626
CMD_ECHO = 1
@@ -258,12 +258,8 @@ def __init__(self, i2caddress=0x33, refreshRate=3):
258258
"""
259259
ctx = usb1.LibUSBContext()
260260

261-
try:
262-
self.usbdev = ctx.getByVendorIDAndProductID(USB2FIR_VID, USB2FIR_PID[0])
263-
self.usbhandle = self.usbdev.open()
264-
except AttributeError:
265-
self.usbdev = ctx.getByVendorIDAndProductID(USB2FIR_VID, USB2FIR_PID[1])
266-
self.usbhandle = self.usbdev.open()
261+
self.usbdev = ctx.getByVendorIDAndProductID(USB2FIR_VID, USB2FIR_PID)
262+
self.usbhandle = self.usbdev.open()
267263

268264
self.usbhandle.claimInterface(0)
269265
self.i2caddress = i2caddress

0 commit comments

Comments
 (0)