diff --git a/api/src/opentrons/hardware_control/emulation/heater_shaker.py b/api/src/opentrons/hardware_control/emulation/heater_shaker.py index ed6817c8664..98066d8651c 100644 --- a/api/src/opentrons/hardware_control/emulation/heater_shaker.py +++ b/api/src/opentrons/hardware_control/emulation/heater_shaker.py @@ -134,7 +134,8 @@ def _get_labware_latch_state(self, command: Command) -> str: return f"M241 STATUS:{self._latch_status.value.upper()}" def _deactivate_heater(self, command: Command) -> str: - pass + self._temperature.set_target(None) + return f"M106" @staticmethod def get_terminator() -> bytes: diff --git a/api/src/opentrons/hardware_control/emulation/simulations.py b/api/src/opentrons/hardware_control/emulation/simulations.py index c8604760861..a9b46b18cb4 100644 --- a/api/src/opentrons/hardware_control/emulation/simulations.py +++ b/api/src/opentrons/hardware_control/emulation/simulations.py @@ -40,7 +40,7 @@ def deactivate(self, temperature: float) -> None: self._target = None self._current = temperature - def set_target(self, target: float) -> None: + def set_target(self, target: Optional[float]) -> None: self._target = target @property diff --git a/api/tests/opentrons/hardware_control/integration/test_heatershaker.py b/api/tests/opentrons/hardware_control/integration/test_heatershaker.py index 022b851993b..1a41a857df5 100644 --- a/api/tests/opentrons/hardware_control/integration/test_heatershaker.py +++ b/api/tests/opentrons/hardware_control/integration/test_heatershaker.py @@ -80,11 +80,25 @@ async def test_deactivate_shaker(heatershaker: HeaterShaker) -> None: assert heatershaker.target_speed is None assert heatershaker.speed == 0 +async def test_deactivate_heater(heatershaker: HeaterShaker) -> None: + await heatershaker.wait_next_poll() + await heatershaker.start_set_temperature(50.0) + await heatershaker.await_temperature(50.0) + assert heatershaker.target_temperature == 50.0 + assert 49.3 <= heatershaker.temperature <= 50.7 + + await heatershaker.deactivate_heater() + assert heatershaker.target_temperature is None + + assert 49.3 <= heatershaker.temperature <= 50.7 # Temp should not change + await heatershaker.wait_next_poll() + await heatershaker.wait_next_poll() + await heatershaker.wait_next_poll() + assert 49.3 <= heatershaker.temperature <= 50.7 # Temp should not change + async def test_temp(heatershaker: HeaterShaker) -> None: """Test setting temp""" - await heatershaker.wait_next_poll() - await heatershaker.start_set_temperature(50.0) # Have to wait for next poll because target temp will not update until then await heatershaker.wait_next_poll()