api/pupdevices/Remote: publish draft api

This commit is contained in:
Laurens Valk
2020-12-29 19:51:48 +01:00
parent 32a47bcee0
commit c2d2884794
4 changed files with 41 additions and 13 deletions
+9 -10
View File
@@ -25,22 +25,21 @@ class Motor(_Motor):
pass
class RemoteControl:
"""LEGO® Powered Up Bluetooth Remote Control/Handset."""
class Remote:
"""LEGO® Powered Up Bluetooth Remote Control."""
light = _ColorLight()
buttons = _Keypad()
address = None
"""Bluetooth address of the remote."""
def __init__(self, device=None, timeout=10000):
"""Connect the handset to the hub.
def __init__(self, address=None, timeout=10000):
"""Connects to the remote.
Arguments:
device (str): Bluetooth address of the handset (? TODO ?).
If you do not specify a device identifier, the hub will
attempt to pair with any handset that is currently in
advertising mode.
timeout (:ref:`time`): The amount of time before giving up
searching.
device (str): Bluetooth address of the remote. If no address is
given, it connects to the first available remote that it finds.
timeout (:ref:`time`): How long to search for the remote.
"""
pass
+4 -3
View File
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
from typing import Collection, List, Optional, Tuple
from typing import Collection, List, Optional, Tuple, Union
from ._common import Keypad, DCMotor, ColorLight, LightArray, Motor as BaseMotor, Light as BaseLight
@@ -9,10 +9,11 @@ from .parameters import Color, Direction, Port
class Motor(BaseMotor): ...
class RemoteControl:
class Remote:
light: ColorLight
buttons: Keypad
def __init__(self, device: str = None, timeout: int = 10000): ...
addresss: Union[str, None]
def __init__(self, address: str = None, timeout: int = 10000): ...
class TiltSensor:
def __init__(self, port: Port): ...