We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 958fc64 commit b12ab13Copy full SHA for b12ab13
can/interfaces/pcan/pcan.py
@@ -268,6 +268,12 @@ def __init__(
268
269
self.check_api_version()
270
271
+ if not isinstance(state, BusState):
272
+ try:
273
+ state = BusState[state]
274
+ except KeyError as e:
275
+ raise ValueError("State must be ACTIVE or PASSIVE") from e
276
+
277
if state in [BusState.ACTIVE, BusState.PASSIVE]:
278
self.state = state
279
else:
doc/interfaces/pcan.rst
@@ -15,7 +15,7 @@ Here is an example configuration file for using `PCAN-USB <https://www.peak-syst
15
[default]
16
interface = pcan
17
channel = PCAN_USBBUS1
18
- state = can.bus.BusState.PASSIVE
+ state = PASSIVE
19
bitrate = 500000
20
21
``channel`` (default ``"PCAN_USBBUS1"``)
0 commit comments