Classes | |
| class | MQTTDiscoveryPayload |
| class | MQTTIntegrationDiscoveryConfig |
Functions | |
| bool | _async_process_discovery_migration (MQTTDiscoveryPayload payload) |
| MQTTDiscoveryPayload | _generate_device_config (HomeAssistant hass, str object_id, str|None node_id, bool migrate_discovery=False) |
| None | _merge_common_device_options (MQTTDiscoveryPayload component_config, dict[str, Any] device_config) |
| MQTTDiscoveryPayload | _parse_device_payload (HomeAssistant hass, ReceivePayloadType payload, str object_id, str|None node_id) |
| None | _replace_abbreviations (dict[str, Any]|str payload, dict[str, str] abbreviations, set[str] abbreviations_set) |
| None | _replace_all_abbreviations (dict[str, Any] discovery_payload, bool component_only=False) |
| None | _replace_topic_base (MQTTDiscoveryPayload discovery_payload) |
| bool | _valid_origin_info (MQTTDiscoveryPayload discovery_payload) |
| None | async_log_discovery_origin_info (str message, MQTTDiscoveryPayload discovery_payload, int level=logging.INFO) |
| None | async_start (HomeAssistant hass, str discovery_topic, ConfigEntry config_entry) |
| None | async_stop (HomeAssistant hass) |
| None | clear_discovery_hash (HomeAssistant hass, tuple[str, str] discovery_hash) |
| str | get_origin_log_string (MQTTDiscoveryPayload discovery_payload, *bool include_url) |
| str|None | get_origin_support_url (MQTTDiscoveryPayload discovery_payload) |
| None | set_discovery_hash (HomeAssistant hass, tuple[str, str] discovery_hash) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| ABBREVIATIONS_SET = set(ABBREVIATIONS) | |
| string | CONF_MIGRATE_DISCOVERY = "migrate_discovery" |
| DEVICE_ABBREVIATIONS_SET = set(DEVICE_ABBREVIATIONS) | |
| MIGRATE_DISCOVERY_SCHEMA | |
| ORIGIN_ABBREVIATIONS_SET = set(ORIGIN_ABBREVIATIONS) | |
| string | TOPIC_BASE = "~" |
| TOPIC_MATCHER | |
Support for MQTT discovery.
|
private |
Process a discovery migration request in the discovery payload.
Definition at line 100 of file discovery.py.
|
private |
Generate a cleanup or discovery migration message on device cleanup. If an empty payload, or a migrate discovery request is received for a device, we forward an empty payload for all previously discovered components.
Definition at line 241 of file discovery.py.
|
private |
Merge common device options with the component config options.
Common options are:
CONF_AVAILABILITY,
CONF_AVAILABILITY_MODE,
CONF_AVAILABILITY_TEMPLATE,
CONF_AVAILABILITY_TOPIC,
CONF_COMMAND_TOPIC,
CONF_PAYLOAD_AVAILABLE,
CONF_PAYLOAD_NOT_AVAILABLE,
CONF_STATE_TOPIC,
Common options in the body of the device based config are inherited into
the component. Unless the option is explicitly specified at component level,
in that case the option at component level will override the common option.
Definition at line 331 of file discovery.py.
|
private |
Parse a device discovery payload. The device discovery payload is translated info the config payloads for every single component inside the device based configuration. An empty payload is translated in a cleanup, which forwards an empty payload to all removed components.
Definition at line 270 of file discovery.py.
|
private |
Replace abbreviations in an MQTT discovery payload.
Definition at line 171 of file discovery.py.
|
private |
Replace all abbreviations in an MQTT discovery payload.
Definition at line 184 of file discovery.py.
|
private |
Replace topic base in MQTT discovery data.
Definition at line 220 of file discovery.py.
|
private |
Parse and validate origin info from a single component discovery payload.
Definition at line 314 of file discovery.py.
| None homeassistant.components.mqtt.discovery.async_log_discovery_origin_info | ( | str | message, |
| MQTTDiscoveryPayload | discovery_payload, | ||
| int | level = logging.INFO |
||
| ) |
Log information about the discovery and origin.
Definition at line 154 of file discovery.py.
| None homeassistant.components.mqtt.discovery.async_start | ( | HomeAssistant | hass, |
| str | discovery_topic, | ||
| ConfigEntry | config_entry | ||
| ) |
Start MQTT Discovery.
Definition at line 354 of file discovery.py.
| None homeassistant.components.mqtt.discovery.async_stop | ( | HomeAssistant | hass | ) |
Stop MQTT Discovery.
Definition at line 694 of file discovery.py.
| None homeassistant.components.mqtt.discovery.clear_discovery_hash | ( | HomeAssistant | hass, |
| tuple[str, str] | discovery_hash | ||
| ) |
Clear entry from already discovered list.
Definition at line 117 of file discovery.py.
| str homeassistant.components.mqtt.discovery.get_origin_log_string | ( | MQTTDiscoveryPayload | discovery_payload, |
| *bool | include_url | ||
| ) |
Get the origin information from a discovery payload for logging.
Definition at line 128 of file discovery.py.
| str | None homeassistant.components.mqtt.discovery.get_origin_support_url | ( | MQTTDiscoveryPayload | discovery_payload | ) |
Get the origin information support URL from a discovery payload.
Definition at line 145 of file discovery.py.
| None homeassistant.components.mqtt.discovery.set_discovery_hash | ( | HomeAssistant | hass, |
| tuple[str, str] | discovery_hash | ||
| ) |
Add entry to already discovered list.
Definition at line 122 of file discovery.py.
|
private |
Definition at line 57 of file discovery.py.
| homeassistant.components.mqtt.discovery.ABBREVIATIONS_SET = set(ABBREVIATIONS) |
Definition at line 53 of file discovery.py.
| string homeassistant.components.mqtt.discovery.CONF_MIGRATE_DISCOVERY = "migrate_discovery" |
Definition at line 76 of file discovery.py.
| homeassistant.components.mqtt.discovery.DEVICE_ABBREVIATIONS_SET = set(DEVICE_ABBREVIATIONS) |
Definition at line 54 of file discovery.py.
| homeassistant.components.mqtt.discovery.MIGRATE_DISCOVERY_SCHEMA |
Definition at line 78 of file discovery.py.
| homeassistant.components.mqtt.discovery.ORIGIN_ABBREVIATIONS_SET = set(ORIGIN_ABBREVIATIONS) |
Definition at line 55 of file discovery.py.
| string homeassistant.components.mqtt.discovery.TOPIC_BASE = "~" |
Definition at line 74 of file discovery.py.
| homeassistant.components.mqtt.discovery.TOPIC_MATCHER |
Definition at line 59 of file discovery.py.