Skip to content

Commit f509178

Browse files
committed
pybricks.pupdevices.Motor: Document close.
1 parent fd61866 commit f509178

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
## Added
88
- Enabled tilt and orientation config for `MoveHub()`.
9+
- Documented `Motor.close()`
910

1011
## Fixed
1112
- Fixed missing awaitable for `Remote.light` and LWP3 writes.

doc/main/pupdevices/motor.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Motors with rotation sensors
6262

6363
.. automethod:: pybricks.pupdevices.Motor.settings
6464

65+
.. automethod:: pybricks.pupdevices.Motor.close
66+
6567
.. rubric:: Control settings
6668

6769
.. pybricks-requirements:: pybricks-common-control

src/pybricks/_common.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,16 @@ def track_target(self, target_angle: Number) -> None:
605605
rotate to.
606606
"""
607607

608+
def close(self) -> None:
609+
"""close()
610+
611+
Closes the motor object so you can call ``Motor`` again to initialize
612+
a new object.
613+
614+
This allows advanced users to change properties such as gearing in the
615+
middle of the program, which can be useful for removeable attachments.
616+
"""
617+
608618

609619
class Speaker:
610620
"""Plays beeps and sounds using a speaker."""

0 commit comments

Comments
 (0)