From 87f7c89ef73905c7120ce3012fea4b03a96895eb Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Tue, 28 Nov 2023 17:00:02 +0100
Subject: [PATCH] Tries to fix adafruit warning

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

diff --git a/ohmpi/hardware_components/raspberry_pi.py b/ohmpi/hardware_components/raspberry_pi.py
index 6ea597de..3bfa2af7 100644
--- a/ohmpi/hardware_components/raspberry_pi.py
+++ b/ohmpi/hardware_components/raspberry_pi.py
@@ -44,14 +44,16 @@ class Ctl(CtlAbstract):
         except RuntimeWarning:
             pass
 
+        warnings.resetwarnings()
         # Extended I2C
         try:
             self.interfaces['i2c_ext'] = ExtendedI2C(4)  # 4 is defined
-        # except RuntimeWarning:
-            # pass
+        except RuntimeWarning:
+            pass
         except Exception as e:
             self.exec_logger.warning(f'Could not initialize Extended I2C:\n{e}')
-        warnings.resetwarnings()
+
+
 
         # modbus
         try:
-- 
GitLab