a5d2865eb2
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
"""Constants for the Denon AVR Bluetooth integration."""
|
|
from __future__ import annotations
|
|
|
|
from typing import Final
|
|
|
|
DOMAIN: Final = "denon_bt"
|
|
|
|
# Bluetooth RFCOMM
|
|
RFCOMM_CHANNEL: Final = 2
|
|
CONNECT_TIMEOUT: Final = 10
|
|
RECONNECT_INTERVAL: Final = 30 # max seconds between reconnect attempts
|
|
|
|
# Volume: raw byte / 2 = display value. 98 raw = display 49 (comfortable max).
|
|
VOLUME_PRACTICAL_MAX: Final = 98
|
|
|
|
# ── Protocol commands (Phone → AVR) ─────────────────────────────────────────
|
|
|
|
CMD_VOLUME_UP: Final = bytes([0x41, 0x54, 0x07, 0x00, 0x00, 0x00])
|
|
CMD_VOLUME_DOWN: Final = bytes([0x41, 0x54, 0x07, 0x01, 0x00, 0x00])
|
|
CMD_GET_SOURCES: Final = bytes([0x41, 0x54, 0x00, 0x04, 0x00, 0x00])
|
|
CMD_GET_STATUS: Final = bytes([0x41, 0x54, 0x00, 0x06, 0x00, 0x00])
|
|
CMD_MUTE_ON: Final = bytes([0x41, 0x54, 0x07, 0x1D, 0x01, 0x01, 0xFE])
|
|
CMD_MUTE_OFF: Final = bytes([0x41, 0x54, 0x07, 0x1D, 0x01, 0x00, 0xFF])
|
|
CMD_POWER_OFF: Final = bytes([0x41, 0x54, 0x00, 0x0A, 0x01, 0x00, 0xFF])
|
|
CMD_POWER_ON: Final = bytes([0x41, 0x54, 0x00, 0x0A, 0x01, 0x01, 0xFE])
|
|
|
|
# ── Known input source byte codes ───────────────────────────────────────────
|
|
|
|
DEFAULT_SOURCES: Final = {
|
|
0x40: "Bluetooth",
|
|
0x55: "Media Player",
|
|
0x52: "CBL/SAT",
|
|
0x53: "DVD",
|
|
0x54: "Blu-ray",
|
|
0x56: "Game",
|
|
0x57: "AUX",
|
|
}
|