Export MQTT subscription helpers at integration level (#116150)
parent
6da432a5c3
commit
589104f63d
|
@ -87,6 +87,12 @@ from .models import ( # noqa: F401
|
|||
ReceiveMessage,
|
||||
ReceivePayloadType,
|
||||
)
|
||||
from .subscription import ( # noqa: F401
|
||||
EntitySubscription,
|
||||
async_prepare_subscribe_topics,
|
||||
async_subscribe_topics,
|
||||
async_unsubscribe_topics,
|
||||
)
|
||||
from .util import ( # noqa: F401
|
||||
async_create_certificate_temp_files,
|
||||
async_forward_entry_setup_and_setup_discovery,
|
||||
|
|
|
@ -16,7 +16,7 @@ from hatasmota.models import TasmotaDeviceConfig
|
|||
from hatasmota.mqtt import TasmotaMQTTClient
|
||||
|
||||
from homeassistant.components import mqtt
|
||||
from homeassistant.components.mqtt.subscription import (
|
||||
from homeassistant.components.mqtt import (
|
||||
async_prepare_subscribe_topics,
|
||||
async_subscribe_topics,
|
||||
async_unsubscribe_topics,
|
||||
|
|
|
@ -4491,3 +4491,31 @@ async def test_loop_write_failure(
|
|||
await hass.async_block_till_done()
|
||||
|
||||
assert "Disconnected from MQTT server mock-broker:1883 (7)" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"attr",
|
||||
[
|
||||
"EntitySubscription",
|
||||
"MqttCommandTemplate",
|
||||
"MqttValueTemplate",
|
||||
"PayloadSentinel",
|
||||
"PublishPayloadType",
|
||||
"ReceiveMessage",
|
||||
"ReceivePayloadType",
|
||||
"async_prepare_subscribe_topics",
|
||||
"async_publish",
|
||||
"async_subscribe",
|
||||
"async_subscribe_topics",
|
||||
"async_unsubscribe_topics",
|
||||
"async_wait_for_mqtt_client",
|
||||
"publish",
|
||||
"subscribe",
|
||||
"valid_publish_topic",
|
||||
"valid_qos_schema",
|
||||
"valid_subscribe_topic",
|
||||
],
|
||||
)
|
||||
async def test_mqtt_integration_level_imports(hass: HomeAssistant, attr: str) -> None:
|
||||
"""Test mqtt integration level public published imports are available."""
|
||||
assert hasattr(mqtt, attr)
|
||||
|
|
Loading…
Reference in New Issue