diff --git a/hardware_components/abstract_hardware_components.py b/hardware_components/abstract_hardware_components.py index 10b817af405b48bab30828c86323497d7d8012d0..f328593e7ab8ea7cd65c2b38d91090e85e6b2291 100644 --- a/hardware_components/abstract_hardware_components.py +++ b/hardware_components/abstract_hardware_components.py @@ -46,15 +46,9 @@ class MuxAbstract(ABC): self.controller = kwargs.pop('controller', None) self.addresses = kwargs.pop('addresses', None) + @abstractmethod def _get_addresses(self, addresses_file): - with open(addresses_file, 'r') as f: - x = json.load(f) - - self.addresses = {} - for k in x.keys(): - y = k.strip('(').strip(')').split(', ') - x[k]['TCA'] - self.addresses.update({(int(y[0]), y[1]): x[k]}) + pass @abstractmethod def reset(self): diff --git a/hardware_components/mux_2024_rev_0_0.py b/hardware_components/mux_2024_rev_0_0.py index a34ffdf39260c49e7d65fc451c4c7a3d77950252..6065d3c41e15b97589a037cf580241a3d592a47f 100644 --- a/hardware_components/mux_2024_rev_0_0.py +++ b/hardware_components/mux_2024_rev_0_0.py @@ -1,5 +1,6 @@ from OhmPi.config import HARDWARE_CONFIG import os +import json from OhmPi.hardware_components import MuxAbstract import adafruit_tca9548a # noqa from adafruit_mcp230xx.mcp23017 import MCP23017 # noqa @@ -17,6 +18,15 @@ class Mux(MuxAbstract): self._get_addresses(MUX_CONFIG['addresses']) self.exec_logger.debug(f'Using {MUX_CONFIG["addresses"]} for {self.board_name}...') + def _get_addresses(self, addresses_file): + with open(addresses_file, 'r') as f: + x = json.load(f) + + self.addresses = {} + for k in x.keys(): + y = k.strip('(').strip(')').split(', ') + self.addresses.update({(int(y[0]), y[1]): x[k]}) + def reset(self): pass