pybricks.pupdevices.Motor: Document close.

This commit is contained in:
Laurens Valk
2023-11-20 14:03:12 +01:00
parent fd61866f2b
commit f509178dab
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -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.
+2
View File
@@ -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
+10
View File
@@ -605,6 +605,16 @@ class Motor(DCMotor):
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."""