From c12f1e5fae5a3729b237730bb72b96b432caf8ef Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Thu, 8 Jun 2023 09:59:51 +0200
Subject: [PATCH] Tries to fix "dict has no attribute bus" error

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

diff --git a/ohmpi/hardware_components/ohmpi_card_3_15.py b/ohmpi/hardware_components/ohmpi_card_3_15.py
index e378bdc3..9220faf4 100644
--- a/ohmpi/hardware_components/ohmpi_card_3_15.py
+++ b/ohmpi/hardware_components/ohmpi_card_3_15.py
@@ -206,6 +206,8 @@ class Rx(RxAbstract):
         super().__init__(**kwargs)
         if self.ctl is None:
             self.ctl = ctl_module.Ctl()
+        elif isinstance(self.ctl, dict):
+            self.ctl = ctl_module.Ctl(self.ctl)
         print(f'ctl: {self.ctl}, {type(self.ctl)}')  # TODO: delete me!
         # ADS1115 for voltage measurement (MN)
         self._ads_voltage_address = 0x49
-- 
GitLab