From 1c2c49e77d7ba5af032eb3fdd8dde6abf4ccf254 Mon Sep 17 00:00:00 2001 From: su530201 <olivier.kaufmann@umons.ac.be> Date: Tue, 28 Nov 2023 16:47:56 +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 53893a97..d3333c08 100644 --- a/ohmpi/hardware_components/raspberry_pi.py +++ b/ohmpi/hardware_components/raspberry_pi.py @@ -43,7 +43,6 @@ class Ctl(CtlAbstract): self.interfaces['i2c'] = busio.I2C(board.SCL, board.SDA) # noqa except RuntimeWarning: pass - warnings.resetwarnings() # Extended I2C try: @@ -53,6 +52,8 @@ class Ctl(CtlAbstract): except Exception as e: self.exec_logger.warning(f'Could not initialize Extended I2C:\n{e}') + warnings.resetwarnings() + # modbus try: self.interfaces['modbus'] = minimalmodbus.Instrument(port=kwargs['modbus_port'], -- GitLab