From 7822012ac1318cdda6abf8180fd39e8f22f048c9 Mon Sep 17 00:00:00 2001
From: Arnaud Watlet <arnaud.watlet@umons.ac.be>
Date: Wed, 29 Nov 2023 10:46:26 +0100
Subject: [PATCH] Solves issue #127

---
 ohmpi/hardware_components/raspberry_pi.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ohmpi/hardware_components/raspberry_pi.py b/ohmpi/hardware_components/raspberry_pi.py
index 86a96d64..1d2b0eed 100644
--- a/ohmpi/hardware_components/raspberry_pi.py
+++ b/ohmpi/hardware_components/raspberry_pi.py
@@ -37,9 +37,7 @@ class Ctl(CtlAbstract):
         # None interface for battery
         self.interfaces['none'] = None
 
-        # warnings.filterwarnings("error")  # to filter out adafruit warning about setting I2C frequency
         # I2C
-        warnings.filterwarnings(RuntimeWarning, action='ignore', module=busio)
         try:
             self.interfaces['i2c'] = busio.I2C(board.SCL, board.SDA)  # noqa
         except Exception as e:
@@ -47,7 +45,7 @@ class Ctl(CtlAbstract):
 
        # warnings.resetwarnings()
         # Extended I2C
-        warnings.filterwarnings(RuntimeWarning, action='ignore', module=ExtendedI2C)
+        warnings.filterwarnings(action='ignore', category=RuntimeWarning, module='adafruit_blinka')  # to filter out adafruit warning about setting I2C frequency
         try:
             self.interfaces['i2c_ext'] = ExtendedI2C(4)  # 4 is defined
         except Exception as e:
-- 
GitLab