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

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

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