Skip to content

Commit 973566c

Browse files
committed
Serial: use exclusive access #35
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
1 parent 6574810 commit 973566c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pylontech/pylontech.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class Pylontech:
141141
)
142142

143143
def __init__(self, serial_port='/dev/ttyUSB0', baudrate=115200):
144-
self.s = serial.Serial(serial_port, baudrate, bytesize=8, parity=serial.PARITY_NONE, stopbits=1, timeout=2)
144+
self.s = serial.Serial(serial_port, baudrate, bytesize=8, parity=serial.PARITY_NONE, stopbits=1, timeout=2, exclusive=True)
145145

146146

147147
@staticmethod

0 commit comments

Comments
 (0)