Add MQTT encoding parameter for all subscribed topics (#62263)
* Add encoding parameter for all subscribable topics * test setup encoding incoming payload * remove support for device_tracker and tag+tests
This commit is contained in:
parent
3ca18922e6
commit
dd0193052c
33 changed files with 737 additions and 5 deletions
|
@ -54,6 +54,7 @@ from .test_common import (
|
|||
help_test_discovery_update,
|
||||
help_test_discovery_update_attr,
|
||||
help_test_discovery_update_unchanged,
|
||||
help_test_encoding_subscribable_topics,
|
||||
help_test_entity_debug_info_message,
|
||||
help_test_entity_device_info_remove,
|
||||
help_test_entity_device_info_update,
|
||||
|
@ -3165,3 +3166,29 @@ async def test_reloadable(hass, mqtt_mock, caplog, tmp_path):
|
|||
domain = cover.DOMAIN
|
||||
config = DEFAULT_CONFIG[domain]
|
||||
await help_test_reloadable(hass, mqtt_mock, caplog, tmp_path, domain, config)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"topic,value,attribute,attribute_value",
|
||||
[
|
||||
("state_topic", "open", None, None),
|
||||
("state_topic", "closing", None, None),
|
||||
("position_topic", "40.0", "current_position", 40.0),
|
||||
("tilt_status_topic", "60.0", "current_tilt_position", 60.0),
|
||||
],
|
||||
)
|
||||
async def test_encoding_subscribable_topics(
|
||||
hass, mqtt_mock, caplog, topic, value, attribute, attribute_value
|
||||
):
|
||||
"""Test handling of incoming encoded payload."""
|
||||
await help_test_encoding_subscribable_topics(
|
||||
hass,
|
||||
mqtt_mock,
|
||||
caplog,
|
||||
cover.DOMAIN,
|
||||
DEFAULT_CONFIG[cover.DOMAIN],
|
||||
topic,
|
||||
value,
|
||||
attribute,
|
||||
attribute_value,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue