Skip to content

Commit

Permalink
union of simulating port
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Mar 4, 2024
1 parent 9b6ebd4 commit 880db71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/src/opentrons/drivers/rpi_drivers/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ class USBDriverInterface(Protocol):
def match_virtual_ports(
self,
virtual_port: Union[List[ModuleAtPort], List[SimulatingModuleAtPort]],
) -> List[ModuleAtPort]:
) -> Union[List[ModuleAtPort], List[SimulatingModuleAtPort]]:
...
11 changes: 7 additions & 4 deletions api/src/opentrons/drivers/rpi_drivers/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
import subprocess
import re
import os
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 opentrons.hardware_control.types import BoardRevision

from .interfaces import USBDriverInterface
Expand Down Expand Up @@ -79,8 +82,8 @@ def _read_usb_bus(self) -> List[USBPort]:

def match_virtual_ports(
self,
virtual_ports: List[ModuleAtPort],
) -> List[ModuleAtPort]:
virtual_ports: Union[List[ModuleAtPort], List[SimulatingModuleAtPort]],
) -> Union[List[ModuleAtPort], List[SimulatingModuleAtPort]]:
"""
Match Virtual Ports
Expand Down
4 changes: 1 addition & 3 deletions api/src/opentrons/drivers/rpi_drivers/usb_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
class USBBusSimulator(USBDriverInterface):
def match_virtual_ports(
self,
virtual_port: Union[
List[ModuleAtPort], List[SimulatingModuleAtPort]
], # should probably one use simulating
virtual_port: Union[List[ModuleAtPort], List[SimulatingModuleAtPort]],
) -> Union[List[ModuleAtPort], List[SimulatingModuleAtPort]]:
return virtual_port

0 comments on commit 880db71

Please sign in to comment.