diff --git a/api/src/opentrons/drivers/rpi_drivers/interfaces.py b/api/src/opentrons/drivers/rpi_drivers/interfaces.py index 3923b250a27..d52288ae2d4 100644 --- a/api/src/opentrons/drivers/rpi_drivers/interfaces.py +++ b/api/src/opentrons/drivers/rpi_drivers/interfaces.py @@ -1,12 +1,15 @@ -from typing import List +from typing import List, Union from typing_extensions import Protocol -from opentrons.hardware_control.modules.types import ModuleAtPort +from opentrons.hardware_control.modules.types import ( + ModuleAtPort, + SimulatingModuleAtPort, +) class USBDriverInterface(Protocol): def match_virtual_ports( self, - virtual_port: List[ModuleAtPort], + virtual_port: Union[List[ModuleAtPort], List[SimulatingModuleAtPort]], ) -> List[ModuleAtPort]: ... diff --git a/api/src/opentrons/drivers/rpi_drivers/usb_simulator.py b/api/src/opentrons/drivers/rpi_drivers/usb_simulator.py index d3931c00fdd..8dc06207e46 100644 --- a/api/src/opentrons/drivers/rpi_drivers/usb_simulator.py +++ b/api/src/opentrons/drivers/rpi_drivers/usb_simulator.py @@ -4,15 +4,21 @@ A class to convert info from the usb bus into a more readable format. """ -from typing import List +from typing import List, Union -from opentrons.hardware_control.modules.types import ModuleAtPort +from opentrons.hardware_control.modules.types import ( + ModuleAtPort, + SimulatingModuleAtPort, +) from .interfaces import USBDriverInterface class USBBusSimulator(USBDriverInterface): def match_virtual_ports( - self, virtual_port: List[ModuleAtPort] - ) -> List[ModuleAtPort]: + self, + virtual_port: Union[ + List[ModuleAtPort], List[SimulatingModuleAtPort] + ], # should probably one use simulating + ) -> Union[List[ModuleAtPort], List[SimulatingModuleAtPort]]: return virtual_port diff --git a/api/src/opentrons/hardware_control/modules/types.py b/api/src/opentrons/hardware_control/modules/types.py index 1783c9c2085..7c79f5b0e30 100644 --- a/api/src/opentrons/hardware_control/modules/types.py +++ b/api/src/opentrons/hardware_control/modules/types.py @@ -110,12 +110,8 @@ class ModuleAtPort: usb_port: USBPort = USBPort(name="", port_number=0) -@dataclass -class SimulatingModuleAtPort: +class SimulatingModuleAtPort(ModuleAtPort): serial_numer: str - port: str - name: str - usb_port: USBPort = USBPort(name="", port_number=0) class BundledFirmware(NamedTuple):