From 8870f3ff259ab68325450eaa65a2957495528f00 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Tue, 26 Sep 2023 16:12:16 +0200
Subject: [PATCH] Updates hardware_sytem to handle MUX_CONFIG

---
 ohmpi/hardware_system.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py
index cc0e31a0..bdf03b00 100644
--- a/ohmpi/hardware_system.py
+++ b/ohmpi/hardware_system.py
@@ -108,9 +108,9 @@ class OhmPiHardware:
             mux_module = importlib.import_module(f'ohmpi.hardware_components.{mux_config["model"]}')
             if isinstance(mux_config['ctl'], dict): ### TODO: is this needed?
                 mux_ctl_module = importlib.import_module(f'ohmpi.hardware_components.{mux_config["ctl"]["model"]}')
-                ctl = mux_ctl_module.Ctl(**mux_config['ctl'])  # (**self.ctl)
+                mux_config['ctl'] = mux_ctl_module.Ctl(**mux_config['ctl'])  # (**self.ctl)
             assert issubclass(type(mux_config['ctl']), CtlAbstract)
-            io = mux_config.pop('io', ctl.connections[mux_config.pop('connection', 'i2c')])
+            io = mux_config.pop('io', mux_config['ctl'].connections[mux_config.pop('connection', 'i2c')])
             mux_config.update({'io': io})
             mux_config['id'] = mux_id
 
-- 
GitLab