2018-09-14 09:57:31 +00:00
|
|
|
"""Constants used by multiple MQTT modules."""
|
2020-07-15 18:16:03 +00:00
|
|
|
from homeassistant.const import CONF_PAYLOAD
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
ATTR_DISCOVERY_HASH = "discovery_hash"
|
2020-04-01 17:00:40 +00:00
|
|
|
ATTR_DISCOVERY_PAYLOAD = "discovery_payload"
|
2020-02-25 04:46:02 +00:00
|
|
|
ATTR_DISCOVERY_TOPIC = "discovery_topic"
|
2020-06-23 00:49:01 +00:00
|
|
|
ATTR_PAYLOAD = "payload"
|
|
|
|
ATTR_QOS = "qos"
|
|
|
|
ATTR_RETAIN = "retain"
|
|
|
|
ATTR_TOPIC = "topic"
|
|
|
|
|
|
|
|
CONF_BROKER = "broker"
|
|
|
|
CONF_BIRTH_MESSAGE = "birth_message"
|
|
|
|
CONF_DISCOVERY = "discovery"
|
|
|
|
CONF_QOS = ATTR_QOS
|
|
|
|
CONF_RETAIN = ATTR_RETAIN
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_STATE_TOPIC = "state_topic"
|
2020-06-23 00:49:01 +00:00
|
|
|
CONF_WILL_MESSAGE = "will_message"
|
|
|
|
|
2020-09-19 20:10:01 +00:00
|
|
|
DATA_MQTT_CONFIG = "mqtt_config"
|
|
|
|
|
2020-07-15 18:16:03 +00:00
|
|
|
DEFAULT_PREFIX = "homeassistant"
|
|
|
|
DEFAULT_BIRTH_WILL_TOPIC = DEFAULT_PREFIX + "/status"
|
2020-10-07 12:51:06 +00:00
|
|
|
DEFAULT_DISCOVERY = True
|
2019-10-18 00:04:27 +00:00
|
|
|
DEFAULT_QOS = 0
|
2020-07-15 18:16:03 +00:00
|
|
|
DEFAULT_PAYLOAD_AVAILABLE = "online"
|
|
|
|
DEFAULT_PAYLOAD_NOT_AVAILABLE = "offline"
|
2020-06-23 00:49:01 +00:00
|
|
|
DEFAULT_RETAIN = False
|
2020-06-07 07:21:16 +00:00
|
|
|
|
2020-07-15 18:16:03 +00:00
|
|
|
DEFAULT_BIRTH = {
|
|
|
|
ATTR_TOPIC: DEFAULT_BIRTH_WILL_TOPIC,
|
|
|
|
CONF_PAYLOAD: DEFAULT_PAYLOAD_AVAILABLE,
|
|
|
|
ATTR_QOS: DEFAULT_QOS,
|
|
|
|
ATTR_RETAIN: DEFAULT_RETAIN,
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFAULT_WILL = {
|
|
|
|
ATTR_TOPIC: DEFAULT_BIRTH_WILL_TOPIC,
|
|
|
|
CONF_PAYLOAD: DEFAULT_PAYLOAD_NOT_AVAILABLE,
|
|
|
|
ATTR_QOS: DEFAULT_QOS,
|
|
|
|
ATTR_RETAIN: DEFAULT_RETAIN,
|
|
|
|
}
|
|
|
|
|
2020-06-07 07:21:16 +00:00
|
|
|
MQTT_CONNECTED = "mqtt_connected"
|
|
|
|
MQTT_DISCONNECTED = "mqtt_disconnected"
|
2020-06-23 00:49:01 +00:00
|
|
|
|
|
|
|
PROTOCOL_311 = "3.1.1"
|