mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Use last_step marker on UniFi options flow (#50053)
This commit is contained in:
parent
016a4433d2
commit
d579e3427f
@ -299,6 +299,7 @@ class UnifiOptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
): cv.multi_select(clients_to_block),
|
): cv.multi_select(clients_to_block),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
last_step=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_device_tracker(self, user_input=None):
|
async def async_step_device_tracker(self, user_input=None):
|
||||||
@ -354,6 +355,7 @@ class UnifiOptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
): bool,
|
): bool,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
last_step=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_client_control(self, user_input=None):
|
async def async_step_client_control(self, user_input=None):
|
||||||
@ -391,6 +393,7 @@ class UnifiOptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
}
|
}
|
||||||
),
|
),
|
||||||
errors=errors,
|
errors=errors,
|
||||||
|
last_step=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_statistics_sensors(self, user_input=None):
|
async def async_step_statistics_sensors(self, user_input=None):
|
||||||
@ -413,6 +416,7 @@ class UnifiOptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
): bool,
|
): bool,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
last_step=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _update_options(self):
|
async def _update_options(self):
|
||||||
|
@ -448,6 +448,7 @@ async def test_advanced_option_flow(hass, aioclient_mock):
|
|||||||
|
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["step_id"] == "device_tracker"
|
assert result["step_id"] == "device_tracker"
|
||||||
|
assert not result["last_step"]
|
||||||
assert set(
|
assert set(
|
||||||
result["data_schema"].schema[CONF_SSID_FILTER].options.keys()
|
result["data_schema"].schema[CONF_SSID_FILTER].options.keys()
|
||||||
).intersection(("SSID 1", "SSID 2", "SSID 2_IOT", "SSID 3"))
|
).intersection(("SSID 1", "SSID 2", "SSID 2_IOT", "SSID 3"))
|
||||||
@ -465,6 +466,7 @@ async def test_advanced_option_flow(hass, aioclient_mock):
|
|||||||
|
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["step_id"] == "client_control"
|
assert result["step_id"] == "client_control"
|
||||||
|
assert not result["last_step"]
|
||||||
|
|
||||||
result = await hass.config_entries.options.async_configure(
|
result = await hass.config_entries.options.async_configure(
|
||||||
result["flow_id"],
|
result["flow_id"],
|
||||||
@ -477,6 +479,7 @@ async def test_advanced_option_flow(hass, aioclient_mock):
|
|||||||
|
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["step_id"] == "statistics_sensors"
|
assert result["step_id"] == "statistics_sensors"
|
||||||
|
assert result["last_step"]
|
||||||
|
|
||||||
result = await hass.config_entries.options.async_configure(
|
result = await hass.config_entries.options.async_configure(
|
||||||
result["flow_id"],
|
result["flow_id"],
|
||||||
@ -519,6 +522,7 @@ async def test_simple_option_flow(hass, aioclient_mock):
|
|||||||
|
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["step_id"] == "simple_options"
|
assert result["step_id"] == "simple_options"
|
||||||
|
assert result["last_step"]
|
||||||
|
|
||||||
result = await hass.config_entries.options.async_configure(
|
result = await hass.config_entries.options.async_configure(
|
||||||
result["flow_id"],
|
result["flow_id"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user