From 63de4f25b4b3d61ba2a569329d484b4c41569709 Mon Sep 17 00:00:00 2001 From: tamarzanzouri Date: Tue, 19 Mar 2024 14:18:25 -0400 Subject: [PATCH] fixed ot3 full path to set sn --- .../hardware_control/backends/ot3simulator.py | 14 ++++++++++---- .../hardware_control/test_simulator_setup.py | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/api/src/opentrons/hardware_control/backends/ot3simulator.py b/api/src/opentrons/hardware_control/backends/ot3simulator.py index 09afd7f00ea..f57f02e8c51 100644 --- a/api/src/opentrons/hardware_control/backends/ot3simulator.py +++ b/api/src/opentrons/hardware_control/backends/ot3simulator.py @@ -588,10 +588,16 @@ async def increase_z_l_hold_current(self) -> AsyncIterator[None]: @ensure_yield async def watch(self, loop: asyncio.AbstractEventLoop) -> None: - new_mods_at_ports = [ - modules.ModuleAtPort(port=f"/dev/ot_module_sim_{mod}{str(idx)}", name=mod) - for idx, mod in enumerate(self._stubbed_attached_modules) - ] + new_mods_at_ports = [] + for mod, serials in self._stubbed_attached_modules.items(): + for serial in serials: + new_mods_at_ports.append( + modules.SimulatingModuleAtPort( + port=f"/dev/ot_module_sim_{mod}{str(serial)}", + name=mod, + serial_number=serial, + ) + ) await self.module_controls.register_modules(new_mods_at_ports=new_mods_at_ports) @property diff --git a/api/tests/opentrons/hardware_control/test_simulator_setup.py b/api/tests/opentrons/hardware_control/test_simulator_setup.py index 4dd3e63f84f..ce95b231a25 100644 --- a/api/tests/opentrons/hardware_control/test_simulator_setup.py +++ b/api/tests/opentrons/hardware_control/test_simulator_setup.py @@ -71,6 +71,7 @@ async def test_with_magdeck(setup_klass: Type[simulator_setup.SimulatorSetup]) - "data": {"engaged": True, "height": 3}, "status": "engaged", } + assert simulator.attached_modules[0].device_info["serial"] == "123" async def test_with_thermocycler( @@ -117,6 +118,7 @@ async def test_with_thermocycler( }, "status": "holding at target", } + assert simulator.attached_modules[0].device_info["serial"] == "123" async def test_with_tempdeck(setup_klass: Type[simulator_setup.SimulatorSetup]) -> None: @@ -145,6 +147,7 @@ async def test_with_tempdeck(setup_klass: Type[simulator_setup.SimulatorSetup]) "data": {"currentTemp": 23, "targetTemp": 23}, "status": "holding at target", } + assert simulator.attached_modules[0].device_info["serial"] == "123" def test_persistence_ot2(tmpdir: str) -> None: