Skip to content

Commit 0e2896d

Browse files
authored
Make pylibftdi optional in CLARIOstar backend (#662)
1 parent 09c196f commit 0e2896d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pylabrobot/plate_reading/clario_star_backend.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
import time
77
from typing import List, Optional, Union
88

9-
from pylibftdi import driver
9+
try:
10+
from pylibftdi import driver
11+
12+
HAS_PYLIBFTDI = True
13+
except ImportError as e:
14+
HAS_PYLIBFTDI = False
15+
_FTDI_IMPORT_ERROR = e
1016

1117
from pylabrobot import utils
1218
from pylabrobot.io.ftdi import FTDI
@@ -24,8 +30,9 @@
2430
# Make pylibftdi scan the CLARIOstar VID:PID
2531
# appears as ID 0403:bb68 Future Technology Devices International Limited CLARIOstar
2632

27-
driver.USB_VID_LIST.append(0x0403) # i.e. 1027
28-
driver.USB_PID_LIST.append(0xBB68) # i.e. 47976
33+
if HAS_PYLIBFTDI:
34+
driver.USB_VID_LIST.append(0x0403) # i.e. 1027
35+
driver.USB_PID_LIST.append(0xBB68) # i.e. 47976
2936

3037

3138
class CLARIOStarBackend(PlateReaderBackend):

0 commit comments

Comments
 (0)