diff --git a/doc/main/pupdevices/remote.rst b/doc/main/pupdevices/remote.rst index 025bc6a..fdfa3b8 100644 --- a/doc/main/pupdevices/remote.rst +++ b/doc/main/pupdevices/remote.rst @@ -7,8 +7,7 @@ Remote Control .. autoclass:: pybricks.pupdevices.Remote :no-members: - .. autoattribute:: pybricks.pupdevices::Remote.address - :annotation: + .. automethod:: pybricks.pupdevices::Remote.name .. automethod:: pybricks.pupdevices::Remote.light.on @@ -16,10 +15,6 @@ Remote Control .. automethod:: pybricks.pupdevices::Remote.buttons.pressed -.. note:: - - The ``light`` and ``address`` features are not yet supported. - Examples ------------------- diff --git a/src/pybricks/pupdevices.py b/src/pybricks/pupdevices.py index 8e5ea49..a7838a3 100644 --- a/src/pybricks/pupdevices.py +++ b/src/pybricks/pupdevices.py @@ -38,19 +38,30 @@ class Remote: _Button.LEFT_PLUS, _Button.RIGHT_PLUS )) - address = None - """Bluetooth address of the remote, or ``None`` if it is not connected.""" - def __init__(self, address=None, timeout=10000): - """Connects to the remote. + def __init__(self, name=None, timeout=10000): + """When you instantiate this class, the hub will search for a remote + and connect automatically. + + The remote must be on and ready for a connection, as indicated by a + white blinking light. Arguments: - device (str): Bluetooth address of the remote. If no address is - given, it connects to the first available remote that it finds. + name (str): Bluetooth name of the remote. If no name is given, + the hub connects to the first remote that it finds. timeout (:ref:`time`): How long to search for the remote. """ pass + def name(self, name=None): + """Gets or sets the Bluetooth name of the remote. + + If no name is given, this method returns the current name. + + Arguments: + name (str): New Bluetooth name of the remote. + """ + class TiltSensor: """LEGO® Powered Up Tilt Sensor."""