Only expose MQTT advanced settings in advanced mode (#91996)

This commit is contained in:
Jan Bouwhuis 2023-04-25 22:23:17 +02:00 committed by GitHub
parent 0594fefb0c
commit aab7dffdb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 13 deletions

View file

@ -208,7 +208,8 @@ async def test_user_v5_connection_works(
mock_try_connection.return_value = True
result = await hass.config_entries.flow.async_init(
"mqtt", context={"source": config_entries.SOURCE_USER}
"mqtt",
context={"source": config_entries.SOURCE_USER, "show_advanced_options": True},
)
assert result["type"] == "form"
@ -1015,7 +1016,9 @@ async def test_skipping_advanced_options(
mqtt_mock.async_connect.reset_mock()
result = await hass.config_entries.options.async_init(config_entry.entry_id)
result = await hass.config_entries.options.async_init(
config_entry.entry_id, context={"show_advanced_options": True}
)
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "broker"
@ -1268,7 +1271,9 @@ async def test_setup_with_advanced_settings(
mock_try_connection.return_value = True
result = await hass.config_entries.options.async_init(config_entry.entry_id)
result = await hass.config_entries.options.async_init(
config_entry.entry_id, context={"show_advanced_options": True}
)
assert result["type"] == "form"
assert result["step_id"] == "broker"
assert result["data_schema"].schema["advanced_options"]