mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 17:14:41 +00:00
pybricks.pupdevices.Remote: Add name().
https://github.com/pybricks/support/issues/404
This commit is contained in:
@@ -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
|
||||
-------------------
|
||||
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user