from collections.abc import Callable, Mapping
from typing import final

CECDEVICE_AUDIOSYSTEM: int
CECDEVICE_BROADCAST: int
CECDEVICE_FREEUSE: int
CECDEVICE_PLAYBACKDEVICE1: int
CECDEVICE_PLAYBACKDEVICE2: int
CECDEVICE_PLAYBACKDEVICE3: int
CECDEVICE_RECORDINGDEVICE1: int
CECDEVICE_RECORDINGDEVICE2: int
CECDEVICE_RECORDINGDEVICE3: int
CECDEVICE_RESERVED1: int
CECDEVICE_RESERVED2: int
CECDEVICE_TUNER1: int
CECDEVICE_TUNER2: int
CECDEVICE_TUNER3: int
CECDEVICE_TUNER4: int
CECDEVICE_TV: int
CECDEVICE_UNKNOWN: int
CECDEVICE_UNREGISTERED: int
CEC_ALERT_CONNECTION_LOST: int
CEC_ALERT_PERMISSION_ERROR: int
CEC_ALERT_PHYSICAL_ADDRESS_ERROR: int
CEC_ALERT_PORT_BUSY: int
CEC_ALERT_SERVICE_DEVICE: int
CEC_ALERT_TV_POLL_FAILED: int
CEC_DEVICE_TYPE_AUDIO_SYSTEM: int
CEC_DEVICE_TYPE_PLAYBACK_DEVICE: int
CEC_DEVICE_TYPE_RECORDING_DEVICE: int
CEC_DEVICE_TYPE_RESERVED: int
CEC_DEVICE_TYPE_TUNER: int
CEC_DEVICE_TYPE_TV: int
CEC_MENU_STATE_ACTIVATED: int
CEC_MENU_STATE_DEACTIVATED: int
CEC_OPCODE_ABORT: int
CEC_OPCODE_ACTIVE_SOURCE: int
CEC_OPCODE_CDC: int
CEC_OPCODE_CEC_VERSION: int
CEC_OPCODE_CLEAR_ANALOGUE_TIMER: int
CEC_OPCODE_CLEAR_DIGITAL_TIMER: int
CEC_OPCODE_CLEAR_EXTERNAL_TIMER: int
CEC_OPCODE_DECK_CONTROL: int
CEC_OPCODE_DECK_STATUS: int
CEC_OPCODE_DEVICE_VENDOR_ID: int
CEC_OPCODE_END_ARC: int
CEC_OPCODE_FEATURE_ABORT: int
CEC_OPCODE_GET_CEC_VERSION: int
CEC_OPCODE_GET_MENU_LANGUAGE: int
CEC_OPCODE_GIVE_AUDIO_STATUS: int
CEC_OPCODE_GIVE_DECK_STATUS: int
CEC_OPCODE_GIVE_DEVICE_POWER_STATUS: int
CEC_OPCODE_GIVE_DEVICE_VENDOR_ID: int
CEC_OPCODE_GIVE_OSD_NAME: int
CEC_OPCODE_GIVE_PHYSICAL_ADDRESS: int
CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS: int
CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS: int
CEC_OPCODE_IMAGE_VIEW_ON: int
CEC_OPCODE_INACTIVE_SOURCE: int
CEC_OPCODE_MENU_REQUEST: int
CEC_OPCODE_MENU_STATUS: int
CEC_OPCODE_NONE: int
CEC_OPCODE_PLAY: int
CEC_OPCODE_RECORD_OFF: int
CEC_OPCODE_RECORD_ON: int
CEC_OPCODE_RECORD_STATUS: int
CEC_OPCODE_RECORD_TV_SCREEN: int
CEC_OPCODE_REPORT_ARC_ENDED: int
CEC_OPCODE_REPORT_ARC_STARTED: int
CEC_OPCODE_REPORT_AUDIO_STATUS: int
CEC_OPCODE_REPORT_PHYSICAL_ADDRESS: int
CEC_OPCODE_REPORT_POWER_STATUS: int
CEC_OPCODE_REQUEST_ACTIVE_SOURCE: int
CEC_OPCODE_REQUEST_ARC_END: int
CEC_OPCODE_REQUEST_ARC_START: int
CEC_OPCODE_ROUTING_CHANGE: int
CEC_OPCODE_ROUTING_INFORMATION: int
CEC_OPCODE_SELECT_ANALOGUE_SERVICE: int
CEC_OPCODE_SELECT_DIGITAL_SERVICE: int
CEC_OPCODE_SET_ANALOGUE_TIMER: int
CEC_OPCODE_SET_AUDIO_RATE: int
CEC_OPCODE_SET_DIGITAL_TIMER: int
CEC_OPCODE_SET_EXTERNAL_TIMER: int
CEC_OPCODE_SET_MENU_LANGUAGE: int
CEC_OPCODE_SET_OSD_NAME: int
CEC_OPCODE_SET_OSD_STRING: int
CEC_OPCODE_SET_STREAM_PATH: int
CEC_OPCODE_SET_SYSTEM_AUDIO_MODE: int
CEC_OPCODE_SET_TIMER_PROGRAM_TITLE: int
CEC_OPCODE_STANDBY: int
CEC_OPCODE_START_ARC: int
CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST: int
CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS: int
CEC_OPCODE_TEXT_VIEW_ON: int
CEC_OPCODE_TIMER_CLEARED_STATUS: int
CEC_OPCODE_TIMER_STATUS: int
CEC_OPCODE_TUNER_DEVICE_STATUS: int
CEC_OPCODE_TUNER_STEP_DECREMENT: int
CEC_OPCODE_TUNER_STEP_INCREMENT: int
CEC_OPCODE_USER_CONTROL_PRESSED: int
CEC_OPCODE_USER_CONTROL_RELEASE: int
CEC_OPCODE_VENDOR_COMMAND: int
CEC_OPCODE_VENDOR_COMMAND_WITH_ID: int
CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN: int
CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP: int
EVENT_ACTIVATED: int
EVENT_ALERT: int
EVENT_ALL: int
EVENT_COMMAND: int
EVENT_CONFIG_CHANGE: int
EVENT_KEYPRESS: int
EVENT_LOG: int
EVENT_MENU_CHANGED: int
HAVE_CEC_ADAPTER_DESCRIPTOR: int

@final
class Adapter(object):
    adapter: int
    address: int
    cec_version: str
    language: str
    osd_string: str
    physical_address: str
    vendor: str
    def __init__(self, dev: str | None = None, name: str = 'python-cec', type: int = CEC_DEVICE_TYPE_RECORDING_DEVICE) -> None: ...
    def add_callback(self, handler: Callable[[int, tuple[Mapping[str, object], ...]], None], events: int) -> None: ...
    def can_persist_config(self) -> bool: ...
    def close(self) -> None: ...
    def is_active_source(self, addr: int): ...
    def list_devices(self) -> list[str]: ...
    def persist_config(self) -> None: ...
    def remove_callback(self, handler: Callable[[int, tuple[Mapping[str, object], ...]], None], events: int) -> None: ...
    def set_active_source(self) -> None: ...
    def set_physical_addr(self, addr: int) -> None: ...
    def set_port(self, device: str, port: int) -> None: ...
    def set_stream_path(self, path: int | str) -> None: ...
    def toggle_mute(self) -> None: ...
    def transmit(self, destination: int, opcode: int, parameters: str) -> None: ...
    def volume_down(self) -> None: ...
    def volume_up(self) -> None: ...

@final
class Device(object):
    adapter: Adapter
    address: str
    cec_version: str
    language: str
    osd_string: str
    physical_address: str
    vendor: str
    def __init__(self, id: int | Adapter, type: int) -> None: ...
    def is_active(self) -> bool: ...
    def is_on(self) -> bool | None: ...
    def power_on(self) -> bool: ...
    def set_audio_input(self, addr: int) -> bool | None: ...
    def set_av_input(self, addr: int) -> bool | None: ...
    def standby(self) -> bool: ...
    def transmit(self, destination: int, opcode: int, parameters: str) -> bool | None: ...

def list_adapters() -> list[str]: ...
