Commit a472f5da authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

If i2c_ext_tca not present, do not check for it

No related merge requests found
Showing with 6 additions and 9 deletions
+6 -9
...@@ -114,17 +114,14 @@ class Mux(MuxAbstract): ...@@ -114,17 +114,14 @@ class Mux(MuxAbstract):
self._i2c_ext_tca = None self._i2c_ext_tca = None
if self.connect: if self.connect:
self.soh_logger.info(colored(f'{self.model} - {self.board_id}', 'blue')) self.soh_logger.info(colored(f'{self.model} - {self.board_id}', 'blue'))
try: if self._i2c_ext_tca is not None:
self.reset_i2c_ext_tca() try:
if self._i2c_ext_tca is None: self.reset_i2c_ext_tca()
self.soh_logger.info(colored(
f'TCA9548A I2C ext ...not present','green'))
else:
self.soh_logger.info(colored( self.soh_logger.info(colored(
f'TCA9548A I2C ext ({hex(self._i2c_ext_tca_address)})...OK','green')) f'TCA9548A I2C ext ({hex(self._i2c_ext_tca_address)})...OK','green'))
except Exception as e: except Exception as e:
self.soh_logger.info(colored(f'TCA9548A I2C ext ({hex(self._i2c_ext_tca_address)})...NOT FOUND', self.soh_logger.info(colored(f'TCA9548A I2C ext ({hex(self._i2c_ext_tca_address)})...NOT FOUND',
'red')) 'red'))
# Setup MCPs # Setup MCPs
kwargs.update({'addr2': kwargs.pop('addr2', None)}) kwargs.update({'addr2': kwargs.pop('addr2', None)})
......
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