Skip to content

Commit

Permalink
pybricks.pupdevices.Motor: Document close.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensvalk committed Nov 20, 2023
1 parent fd61866 commit f509178
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Added
- Enabled tilt and orientation config for `MoveHub()`.
- Documented `Motor.close()`

## Fixed
- Fixed missing awaitable for `Remote.light` and LWP3 writes.
Expand Down
2 changes: 2 additions & 0 deletions doc/main/pupdevices/motor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Motors with rotation sensors

.. automethod:: pybricks.pupdevices.Motor.settings

.. automethod:: pybricks.pupdevices.Motor.close

.. rubric:: Control settings

.. pybricks-requirements:: pybricks-common-control
Expand Down
10 changes: 10 additions & 0 deletions src/pybricks/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,16 @@ def track_target(self, target_angle: Number) -> None:
rotate to.
"""

def close(self) -> None:
"""close()
Closes the motor object so you can call ``Motor`` again to initialize
a new object.
This allows advanced users to change properties such as gearing in the
middle of the program, which can be useful for removeable attachments.
"""


class Speaker:
"""Plays beeps and sounds using a speaker."""
Expand Down

0 comments on commit f509178

Please sign in to comment.