<commit_before>"""Constants for the BleBox devices integration."""

from homeassistant.components.cover import (
    DEVICE_CLASS_DOOR,
    DEVICE_CLASS_GATE,
    DEVICE_CLASS_SHUTTER,
    STATE_CLOSED,
    STATE_CLOSING,
    STATE_OPEN,
    STATE_OPENING,
)
from homeassistant.components.switch import DEVICE_CLASS_SWITCH
from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS

DOMAIN = "blebox"
PRODUCT = "product"

DEFAULT_SETUP_TIMEOUT = 3

# translation strings
ADDRESS_ALREADY_CONFIGURED = "address_already_configured"
CANNOT_CONNECT = "cannot_connect"
UNSUPPORTED_VERSION = "unsupported_version"
UNKNOWN = "unknown"

BLEBOX_TO_HASS_DEVICE_CLASSES = {
    "shutter": DEVICE_CLASS_SHUTTER,
    "gatebox": DEVICE_CLASS_DOOR,
    "gate": DEVICE_CLASS_GATE,
    "relay": DEVICE_CLASS_SWITCH,
    "temperature": DEVICE_CLASS_TEMPERATURE,
}

BLEBOX_TO_HASS_COVER_STATES = {
    None: None,
    0: STATE_CLOSING,  # moving down
    1: STATE_OPENING,  # moving up
    2: STATE_OPEN,  # manually stopped
    3: STATE_CLOSED,  # lower limit
    4: STATE_OPEN,  # upper limit / open
    # gateController
    5: STATE_OPEN,  # overload
    6: STATE_OPEN,  # motor failure
    # 7 is not used
    8: STATE_OPEN,  # safety stop
}

BLEBOX_TO_UNIT_MAP = {"celsius": TEMP_CELSIUS}

DEFAULT_HOST = "192.168.0.2"
DEFAULT_PORT = 80<commit_msg>Use new DeviceClass enums in blebox (#61361)<commit_after>"""Constants for the BleBox devices integration."""

from homeassistant.components.cover import (
    STATE_CLOSED,
    STATE_CLOSING,
    STATE_OPEN,
    STATE_OPENING,
    CoverDeviceClass,
)
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
from homeassistant.const import TEMP_CELSIUS

DOMAIN = "blebox"
PRODUCT = "product"

DEFAULT_SETUP_TIMEOUT = 3

# translation strings
ADDRESS_ALREADY_CONFIGURED = "address_already_configured"
CANNOT_CONNECT = "cannot_connect"
UNSUPPORTED_VERSION = "unsupported_version"
UNKNOWN = "unknown"

BLEBOX_TO_HASS_DEVICE_CLASSES = {
    "shutter": CoverDeviceClass.SHUTTER,
    "gatebox": CoverDeviceClass.DOOR,
    "gate": CoverDeviceClass.GATE,
    "relay": SwitchDeviceClass.SWITCH,
    "temperature": SensorDeviceClass.TEMPERATURE,
}

BLEBOX_TO_HASS_COVER_STATES = {
    None: None,
    0: STATE_CLOSING,  # moving down
    1: STATE_OPENING,  # moving up
    2: STATE_OPEN,  # manually stopped
    3: STATE_CLOSED,  # lower limit
    4: STATE_OPEN,  # upper limit / open
    # gateController
    5: STATE_OPEN,  # overload
    6: STATE_OPEN,  # motor failure
    # 7 is not used
    8: STATE_OPEN,  # safety stop
}

BLEBOX_TO_UNIT_MAP = {"celsius": TEMP_CELSIUS}

DEFAULT_HOST = "192.168.0.2"
DEFAULT_PORT = 80
{'fraction_non_alphanumeric': 0.08544187752108544, 'fraction_numerical': 0.0165016501650165, 'mean_word_length': 4.466933867735471, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6706476', 'n_tokens_mistral': 1012, 'n_tokens_neox': 952, 'n_words': 204}