2020-08-26 16:03:03 +00:00
|
|
|
"""Constants for the KNX integration."""
|
|
|
|
from enum import Enum
|
2021-06-01 06:59:23 +00:00
|
|
|
from typing import Final
|
2020-08-26 16:03:03 +00:00
|
|
|
|
|
|
|
from homeassistant.components.climate.const import (
|
2021-06-15 15:51:16 +00:00
|
|
|
CURRENT_HVAC_COOL,
|
|
|
|
CURRENT_HVAC_DRY,
|
|
|
|
CURRENT_HVAC_FAN,
|
|
|
|
CURRENT_HVAC_HEAT,
|
|
|
|
CURRENT_HVAC_OFF,
|
2020-08-26 16:03:03 +00:00
|
|
|
HVAC_MODE_AUTO,
|
|
|
|
HVAC_MODE_COOL,
|
|
|
|
HVAC_MODE_DRY,
|
|
|
|
HVAC_MODE_FAN_ONLY,
|
|
|
|
HVAC_MODE_HEAT,
|
|
|
|
HVAC_MODE_OFF,
|
|
|
|
PRESET_AWAY,
|
|
|
|
PRESET_COMFORT,
|
|
|
|
PRESET_ECO,
|
2020-11-13 08:37:45 +00:00
|
|
|
PRESET_NONE,
|
2020-08-26 16:03:03 +00:00
|
|
|
PRESET_SLEEP,
|
|
|
|
)
|
2021-12-03 17:29:38 +00:00
|
|
|
from homeassistant.const import Platform
|
2020-08-26 16:03:03 +00:00
|
|
|
|
2021-06-01 06:59:23 +00:00
|
|
|
DOMAIN: Final = "knx"
|
2020-08-26 16:03:03 +00:00
|
|
|
|
2021-03-01 20:59:36 +00:00
|
|
|
# Address is used for configuration and services by the same functions so the key has to match
|
2021-06-01 06:59:23 +00:00
|
|
|
KNX_ADDRESS: Final = "address"
|
2021-03-01 20:59:36 +00:00
|
|
|
|
2021-06-01 06:59:23 +00:00
|
|
|
CONF_INVERT: Final = "invert"
|
|
|
|
CONF_KNX_EXPOSE: Final = "expose"
|
2021-06-23 15:20:49 +00:00
|
|
|
CONF_KNX_INDIVIDUAL_ADDRESS: Final = "individual_address"
|
2022-03-29 14:46:02 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
# Connection constants
|
|
|
|
##
|
2021-11-20 10:30:41 +00:00
|
|
|
CONF_KNX_CONNECTION_TYPE: Final = "connection_type"
|
|
|
|
CONF_KNX_AUTOMATIC: Final = "automatic"
|
2021-06-23 15:20:49 +00:00
|
|
|
CONF_KNX_ROUTING: Final = "routing"
|
|
|
|
CONF_KNX_TUNNELING: Final = "tunneling"
|
2022-01-26 05:36:07 +00:00
|
|
|
CONF_KNX_TUNNELING_TCP: Final = "tunneling_tcp"
|
2022-03-29 14:46:02 +00:00
|
|
|
CONF_KNX_LOCAL_IP = "local_ip"
|
|
|
|
CONF_KNX_MCAST_GRP = "multicast_group"
|
|
|
|
CONF_KNX_MCAST_PORT = "multicast_port"
|
|
|
|
|
|
|
|
CONF_KNX_RATE_LIMIT = "rate_limit"
|
|
|
|
CONF_KNX_ROUTE_BACK = "route_back"
|
|
|
|
CONF_KNX_STATE_UPDATER = "state_updater"
|
|
|
|
CONF_KNX_DEFAULT_STATE_UPDATER = True
|
|
|
|
CONF_KNX_DEFAULT_RATE_LIMIT = 20
|
|
|
|
|
|
|
|
|
2021-11-10 19:34:35 +00:00
|
|
|
CONF_PAYLOAD: Final = "payload"
|
|
|
|
CONF_PAYLOAD_LENGTH: Final = "payload_length"
|
2021-06-23 15:20:49 +00:00
|
|
|
CONF_RESET_AFTER: Final = "reset_after"
|
2021-06-24 08:54:04 +00:00
|
|
|
CONF_RESPOND_TO_READ: Final = "respond_to_read"
|
2021-06-01 06:59:23 +00:00
|
|
|
CONF_STATE_ADDRESS: Final = "state_address"
|
|
|
|
CONF_SYNC_STATE: Final = "sync_state"
|
2021-11-20 10:30:41 +00:00
|
|
|
CONF_KNX_INITIAL_CONNECTION_TYPES: Final = [CONF_KNX_TUNNELING, CONF_KNX_ROUTING]
|
|
|
|
|
2021-12-15 18:30:38 +00:00
|
|
|
# yaml config merged with config entry data
|
2021-11-20 10:30:41 +00:00
|
|
|
DATA_KNX_CONFIG: Final = "knx_config"
|
2021-12-15 18:30:38 +00:00
|
|
|
# original hass yaml config
|
|
|
|
DATA_HASS_CONFIG: Final = "knx_hass_config"
|
2020-08-26 16:03:03 +00:00
|
|
|
|
2021-06-01 06:59:23 +00:00
|
|
|
ATTR_COUNTER: Final = "counter"
|
2021-06-26 12:30:36 +00:00
|
|
|
ATTR_SOURCE: Final = "source"
|
2021-03-01 20:59:36 +00:00
|
|
|
|
2020-08-26 16:03:03 +00:00
|
|
|
|
|
|
|
class ColorTempModes(Enum):
|
|
|
|
"""Color temperature modes for config validation."""
|
|
|
|
|
2021-02-24 00:26:17 +00:00
|
|
|
ABSOLUTE = "DPT-7.600"
|
|
|
|
RELATIVE = "DPT-5.001"
|
2020-08-26 16:03:03 +00:00
|
|
|
|
|
|
|
|
2021-12-03 17:29:38 +00:00
|
|
|
SUPPORTED_PLATFORMS: Final = [
|
|
|
|
Platform.BINARY_SENSOR,
|
|
|
|
Platform.BUTTON,
|
|
|
|
Platform.CLIMATE,
|
|
|
|
Platform.COVER,
|
|
|
|
Platform.FAN,
|
|
|
|
Platform.LIGHT,
|
|
|
|
Platform.NOTIFY,
|
|
|
|
Platform.NUMBER,
|
|
|
|
Platform.SCENE,
|
|
|
|
Platform.SELECT,
|
|
|
|
Platform.SENSOR,
|
|
|
|
Platform.SWITCH,
|
|
|
|
Platform.WEATHER,
|
|
|
|
]
|
2020-08-26 16:03:03 +00:00
|
|
|
|
2020-11-13 08:37:45 +00:00
|
|
|
# Map KNX controller modes to HA modes. This list might not be complete.
|
2021-06-01 06:59:23 +00:00
|
|
|
CONTROLLER_MODES: Final = {
|
2020-08-26 16:03:03 +00:00
|
|
|
# Map DPT 20.105 HVAC control modes
|
|
|
|
"Auto": HVAC_MODE_AUTO,
|
|
|
|
"Heat": HVAC_MODE_HEAT,
|
|
|
|
"Cool": HVAC_MODE_COOL,
|
|
|
|
"Off": HVAC_MODE_OFF,
|
|
|
|
"Fan only": HVAC_MODE_FAN_ONLY,
|
|
|
|
"Dry": HVAC_MODE_DRY,
|
|
|
|
}
|
|
|
|
|
2021-06-15 15:51:16 +00:00
|
|
|
CURRENT_HVAC_ACTIONS: Final = {
|
2021-11-11 18:39:57 +00:00
|
|
|
HVAC_MODE_HEAT: CURRENT_HVAC_HEAT,
|
|
|
|
HVAC_MODE_COOL: CURRENT_HVAC_COOL,
|
|
|
|
HVAC_MODE_OFF: CURRENT_HVAC_OFF,
|
|
|
|
HVAC_MODE_FAN_ONLY: CURRENT_HVAC_FAN,
|
|
|
|
HVAC_MODE_DRY: CURRENT_HVAC_DRY,
|
2021-06-15 15:51:16 +00:00
|
|
|
}
|
|
|
|
|
2021-06-01 06:59:23 +00:00
|
|
|
PRESET_MODES: Final = {
|
2020-08-26 16:03:03 +00:00
|
|
|
# Map DPT 20.102 HVAC operating modes to HA presets
|
2020-11-13 08:37:45 +00:00
|
|
|
"Auto": PRESET_NONE,
|
2020-08-26 16:03:03 +00:00
|
|
|
"Frost Protection": PRESET_ECO,
|
|
|
|
"Night": PRESET_SLEEP,
|
|
|
|
"Standby": PRESET_AWAY,
|
|
|
|
"Comfort": PRESET_COMFORT,
|
|
|
|
}
|