from types import TracebackType

class I2CError(IOError): ...

class I2C:
    class Message:
        data: bytes | bytearray | list[int]
        read: bool
        flags: int
        def __init__(self, data: bytes | bytearray | list[int], read: bool = ..., flags: int = ...) -> None: ...

    def __init__(self, devpath: str) -> None: ...
    def __del__(self) -> None: ...
    def __enter__(self) -> I2C: ...  # noqa: Y034
    def __exit__(self, t: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None) -> None: ...
    def transfer(self, address: int, messages: list[Message]) -> None: ...
    def close(self) -> None: ...
    @property
    def fd(self) -> int: ...
    @property
    def devpath(self) -> str: ...
