Support multiple MQTT availability topics (#37418)
* Support multiple MQTT availability topics * Make availability list and availability_topic exclusive * Make availability list and availability_topic exclusive * Add missing abbreviation
This commit is contained in:
1 parent
9ade1de3d5
commit
4b3ad0a1cd
4 files changed
+260
-18
No files matched your search
@@ -16,11 +16,14 @@ from .test_common import (
|
||||
help_test_availability_when_connection_lost,
|
||||
help_test_availability_without_topic,
|
||||
help_test_custom_availability_payload,
|
||||
help_test_default_availability_list_payload,
|
||||
help_test_default_availability_list_single,
|
||||
help_test_default_availability_payload,
|
||||
help_test_discovery_broken,
|
||||
help_test_discovery_removal,
|
||||
help_test_discovery_update,
|
||||
help_test_discovery_update_attr,
|
||||
help_test_discovery_update_availability,
|
||||
help_test_entity_debug_info,
|
||||
help_test_entity_debug_info_max_messages,
|
||||
help_test_entity_debug_info_message,
|
||||
@@ -253,6 +256,20 @@ async def test_default_availability_payload(hass, mqtt_mock):
|
||||
)
|
||||
|
||||
|
||||
async def test_default_availability_list_payload(hass, mqtt_mock):
|
||||
"""Test availability by default payload with defined topic."""
|
||||
await help_test_default_availability_list_payload(
|
||||
hass, mqtt_mock, sensor.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
||||
|
||||
async def test_default_availability_list_single(hass, mqtt_mock, caplog):
|
||||
"""Test availability list and availability_topic are mutually exclusive."""
|
||||
await help_test_default_availability_list_single(
|
||||
hass, mqtt_mock, caplog, sensor.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
||||
|
||||
async def test_custom_availability_payload(hass, mqtt_mock):
|
||||
"""Test availability by custom payload with defined topic."""
|
||||
await help_test_custom_availability_payload(
|
||||
@@ -260,6 +277,13 @@ async def test_custom_availability_payload(hass, mqtt_mock):
|
||||
)
|
||||
|
||||
|
||||
async def test_discovery_update_availability(hass, mqtt_mock):
|
||||
"""Test availability discovery update."""
|
||||
await help_test_discovery_update_availability(
|
||||
hass, mqtt_mock, sensor.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
||||
|
||||
async def test_invalid_device_class(hass, mqtt_mock):
|
||||
"""Test device_class option with invalid value."""
|
||||
assert await async_setup_component(
|
||||
|
||||
Reference in new issue
Block a user