Commit b556b659 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Tests for logger problem with standalone dev/test

Showing with 4 additions and 1 deletion
+4 -1
......@@ -7,7 +7,7 @@ import os
from ohmpi.utils import get_platform
from gpiozero import CPUTemperature # noqa
import warnings
warnings.filterwarnings("error")
class Ctl(CtlAbstract):
def __init__(self, **kwargs):
......@@ -24,6 +24,7 @@ class Ctl(CtlAbstract):
super().__init__(**kwargs)
self.interfaces = dict()
warnings.filterwarnings("error") # to filter out adafruit warning about setting I2C frequency
# I2C
try:
self.interfaces['i2c'] = busio.I2C(board.SCL, board.SDA) # noqa
......@@ -37,6 +38,8 @@ class Ctl(CtlAbstract):
pass
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=modbus_port, slaveaddress=modbus_slave_address)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment