mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 17:46:19 +00:00
api/pupdevices/Remote: publish draft api
This commit is contained in:
+9
-10
@@ -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
|
||||
|
||||
|
||||
@@ -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): ...
|
||||
|
||||
Reference in New Issue
Block a user