diff --git a/src/secop_ophyd/SECoPDevices.py b/src/secop_ophyd/SECoPDevices.py index 416d695..4499f7b 100644 --- a/src/secop_ophyd/SECoPDevices.py +++ b/src/secop_ophyd/SECoPDevices.py @@ -758,10 +758,10 @@ async def stop(self, success=True): """ self._success = success - self.logger.info(f"Stopping {self.name} success={success}") - - await self._secclient.exec_command(self._module, "stop") - self._stopped = True + if not success: + self.logger.info(f"Stopping {self.name} success={success}") + await self._secclient.exec_command(self._module, "stop") + self._stopped = True async def locate(self) -> Location: # return current location of the device (setpoint and readback). diff --git a/tests/test_commands.py b/tests/test_commands.py index b6857ab..894cc3b 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -23,7 +23,7 @@ async def test_stop_cmd(cryo_sim, cryo_node_internal_loop: SECoPNodeDevice): await stat - assert cryo._stopped is True + assert cryo._stopped is False await cryo_node_internal_loop.disconnect_async()