Classes | |
| class | EntitySubscription |
Functions | |
| dict[str, EntitySubscription] | async_prepare_subscribe_topics (HomeAssistant hass, dict[str, EntitySubscription]|None sub_state, dict[str, dict[str, Any]] topics) |
| None | async_subscribe_topics (HomeAssistant hass, dict[str, EntitySubscription] sub_state) |
| None | async_subscribe_topics_internal (HomeAssistant hass, dict[str, EntitySubscription] sub_state) |
| dict[str, EntitySubscription] | async_unsubscribe_topics (HomeAssistant hass, dict[str, EntitySubscription]|None sub_state) |
Variables | |
| async_unsubscribe_topics = partial(async_prepare_subscribe_topics, topics={}) | |
Helper to handle a set of topics to subscribe to.
| dict[str, EntitySubscription] homeassistant.components.mqtt.subscription.async_prepare_subscribe_topics | ( | HomeAssistant | hass, |
| dict[str, EntitySubscription] | None | sub_state, | ||
| dict[str, dict[str, Any]] | topics | ||
| ) |
Prepare (re)subscribe to a set of MQTT topics. State is kept in sub_state and a dictionary mapping from the subscription key to the subscription state. After this function has been called, async_subscribe_topics must be called to finalize any new subscriptions. Please note that the sub state must not be shared between multiple sets of topics. Every call to async_subscribe_topics must always contain _all_ the topics the subscription state should manage.
Definition at line 87 of file subscription.py.
| None homeassistant.components.mqtt.subscription.async_subscribe_topics | ( | HomeAssistant | hass, |
| dict[str, EntitySubscription] | sub_state | ||
| ) |
(Re)Subscribe to a set of MQTT topics.
Definition at line 139 of file subscription.py.
| None homeassistant.components.mqtt.subscription.async_subscribe_topics_internal | ( | HomeAssistant | hass, |
| dict[str, EntitySubscription] | sub_state | ||
| ) |
(Re)Subscribe to a set of MQTT topics. This function is internal to the MQTT integration and should not be called from outside the integration.
Definition at line 148 of file subscription.py.
| dict[str, EntitySubscription] homeassistant.components.mqtt.subscription.async_unsubscribe_topics | ( | HomeAssistant | hass, |
| dict[str, EntitySubscription] | None | sub_state | ||
| ) |
Unsubscribe from all MQTT topics managed by async_subscribe_topics.
Definition at line 163 of file subscription.py.
| homeassistant.components.mqtt.subscription.async_unsubscribe_topics = partial(async_prepare_subscribe_topics, topics={}) |
Definition at line 169 of file subscription.py.