"""Constants."""

# region #-- imports --#
from enum import Enum, unique

# endregion

HDHOMERUN_CONTROL_TCP_PORT: int = 65001
HDHOMERUN_DISCOVER_UDP_PORT: int = 65001

HDHOMERUN_MAX_PACKET_SIZE: int = 1460
HDHOMERUN_MAX_PAYLOAD_SIZE: int = 1452

HDHOMERUN_TYPE_DISCOVER_REQ: int = 0x0002
HDHOMERUN_TYPE_DISCOVER_RPY: int = 0x0003
HDHOMERUN_TYPE_GETSET_REQ: int = 0x0004
HDHOMERUN_TYPE_GETSET_RPY: int = 0x0005
HDHOMERUN_TYPE_UPGRADE_REQ: int = 0x0006
HDHOMERUN_TYPE_UPGRADE_RPY: int = 0x0007

HDHOMERUN_TAG_BASE_URL: int = 0x2A
HDHOMERUN_TAG_DEVICE_AUTH_STR: int = 0x2B
HDHOMERUN_TAG_DEVICE_ID: int = 0x02
HDHOMERUN_TAG_DEVICE_TYPE: int = 0x01
HDHOMERUN_TAG_ERROR_MESSAGE: int = 0x05
HDHOMERUN_TAG_GETSET_NAME: int = 0x03
HDHOMERUN_TAG_GETSET_VALUE: int = 0x04
HDHOMERUN_TAG_LINEUP_URL: int = 0x27
HDHOMERUN_TAG_TUNER_COUNT: int = 0x10

HDHOMERUN_DEVICE_ID_WILDCARD: int = 0xFFFFFFFF
HDHOMERUN_DEVICE_TYPE_STORAGE: int = 0x00000005
HDHOMERUN_DEVICE_TYPE_TUNER: int = 0x00000001
HDHOMERUN_DEVICE_TYPE_WILDCARD: int = 0xFFFFFFFF


@unique
class DiscoverMode(Enum):
    """Available discovery modes."""

    AUTO = 0
    HTTP = 1
    UDP = 2
