From 8d956fff2d752bc2a44a82644b191b679111fc7b Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Thu, 1 Jun 2023 12:17:21 +0200
Subject: [PATCH] Adds option in ohmpi_card_3_15 to create a ctl if ctl config
 is passed as a dict

---
 ohmpi/hardware_components/ohmpi_card_3_15.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ohmpi/hardware_components/ohmpi_card_3_15.py b/ohmpi/hardware_components/ohmpi_card_3_15.py
index a09cf278..58a5f022 100644
--- a/ohmpi/hardware_components/ohmpi_card_3_15.py
+++ b/ohmpi/hardware_components/ohmpi_card_3_15.py
@@ -73,6 +73,7 @@ def _gain_auto(channel):
         gain = 16
     return gain
 
+
 class Tx(TxAbstract):
     def __init__(self, **kwargs):
         kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')})
@@ -82,7 +83,7 @@ class Tx(TxAbstract):
         self.current_adjustable = False
         if self.ctl is None:
             self.ctl = ctl_module.Ctl()
-        elif self.ctl is isinstance(dict):
+        elif isinstance(self.ctl, dict):
             self.ctl = ctl_module.Ctl(dict)
 
         # I2C connexion to MCP23008, for current injection
@@ -206,7 +207,7 @@ class Rx(RxAbstract):
         super().__init__(**kwargs)
         if self.ctl is None:
             self.ctl = ctl_module.Ctl()
-        elif self.ctl is isinstance(dict):
+        elif isinstance(self.ctl, dict):
             self.ctl = ctl_module.Ctl(dict)
 
         # ADS1115 for voltage measurement (MN)
-- 
GitLab