From 498e39dc4442048ab3fcbaecc4eec6370e77a170 Mon Sep 17 00:00:00 2001 From: jgyates Date: Wed, 1 Jan 2025 20:45:48 -0500 Subject: [PATCH] V1.19.05 --- genmonlib/myserial.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/genmonlib/myserial.py b/genmonlib/myserial.py index e01b4918..8dee2f70 100644 --- a/genmonlib/myserial.py +++ b/genmonlib/myserial.py @@ -82,10 +82,18 @@ def __init__( else: self.SerialDevice.bytesize = serial.EIGHTBITS - if Parity == None or Parity == 0 or Parity.lower() == "none": + if isinstance(Parity,str): + if Parity.lower() == "none": + Parity = 0 + elif Parity.lower() == "odd": + Parity = 1 + else: + Parity = 0 + + if Parity == None or Parity == 0: # set parity check: no parity self.SerialDevice.parity = (serial.PARITY_NONE) - elif Parity == 1 or Parity.lower() == "odd": + elif Parity == 1: # set parity check: use odd parity self.SerialDevice.parity = (serial.PARITY_ODD) self.LogError("Serial: Setting ODD parity")