Files
pybricks-api/pybricks/iodevices.pyi
T
David Lechner dca8518575 pybricks: add type hints for v2
This adds PEP 561 style type hints for Pybricks v2 (just EV3).
2020-12-28 16:21:56 -06:00

38 lines
1.2 KiB
Python

# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
from typing import Optional, Tuple
from .parameters import Port
class LUMPDevice:
def __init__(self, port: Port): ...
def read(self, mode: int) -> Tuple: ...
def write(self, mode: int, values: Tuple): ...
class Ev3devSensor:
sensor_index: int
port_index: int
def __init__(self, port: Port): ...
def read(self, mode: int) -> Tuple: ...
class AnalogSensor:
def __init__(self, port: Port): ...
def voltage(self) -> int: ...
def resistance(self) -> int: ...
def active(self) -> None: ...
def passive(self) -> None: ...
class I2CDevice:
def __init__(self, port: Port, address: int): ...
def read(self, reg: Optional[int], length: Optional[int] = 1) -> bytes: ...
def write(self, reg: Optional[int], data: Optional[bytes] = None) -> None: ...
class UARTDevice:
def __init__(self, port: Port, baudrate: int, timeout: Optional[int] = None): ...
def read(self, length: int = 1) -> bytes: ...
def read_all(self) -> bytes: ...
def write(self, data: bytes) -> None: ...
def waiting(self) -> int: ...
def clear(self) -> None: ...