From af878df03fafe4f235a15594df6bc19701a7894d Mon Sep 17 00:00:00 2001 From: gshazen2 Date: Wed, 6 Nov 2024 10:54:56 -0600 Subject: [PATCH] Update SY01B.py Added 'ports' to kwargs in __init__ to enable changing the number of ports set on the SY01B model upon initialization. --- src/elab/SY01B.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/elab/SY01B.py b/src/elab/SY01B.py index b4c8513..11cb522 100644 --- a/src/elab/SY01B.py +++ b/src/elab/SY01B.py @@ -24,6 +24,9 @@ def __init__(self, com_port, **kwargs): if 'address' in kwargs: self.address = kwargs.get('address') + + if 'ports' in kwargs: + self.ports = kwargs.get('ports') if self.verbose == True: print(f'{self.model} connected on {com_port} at {self.baud_rate} bits/s') @@ -297,4 +300,4 @@ def set_total_volume(self,vol): if type(vol) == int: self.total_volume = vol else: - raise TypeError('Volume must be an integer') \ No newline at end of file + raise TypeError('Volume must be an integer')