Skip to content

Commit

Permalink
make stop signature correct
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Apr 18, 2024
1 parent 58dee5d commit 3567340
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ophyd_async/sim/demo/sim_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ def __init__(self, prefix: str, name="", instant=True) -> None:
# Whether set() should complete successfully or not
self._set_success = True

def stop(self):
def stop(self, success=False):
"""
Stop the motor if it is moving
"""
if self._move_task:
self._move_task.cancel()
self._move_task = None

self._set_success = success

def set(self, new_position: float, timeout: Optional[float] = None) -> AsyncStatus: # noqa: F821
"""
Asynchronously move the motor to a new position.
Expand Down

0 comments on commit 3567340

Please sign in to comment.