Drop reconfigure_confirm step in trafikverket_camera (#128031)

* Drop reconfigure_confirm step in trafikverket_camera

* Update strings.json
This commit is contained in:
epenet 2024-10-09 22:14:34 +02:00 committed by GitHub
parent 9bbbb2cd3c
commit 39891ffe60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 10 deletions

View File

@ -94,12 +94,6 @@ class TVCameraConfigFlow(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle re-configuration with Trafikverket.""" """Handle re-configuration with Trafikverket."""
return await self.async_step_reconfigure_confirm()
async def async_step_reconfigure_confirm(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Confirm re-configuration with Trafikverket."""
errors: dict[str, str] = {} errors: dict[str, str] = {}
reconfigure_entry = self._get_reconfigure_entry() reconfigure_entry = self._get_reconfigure_entry()
@ -134,7 +128,7 @@ class TVCameraConfigFlow(ConfigFlow, domain=DOMAIN):
) )
return self.async_show_form( return self.async_show_form(
step_id="reconfigure_confirm", step_id="reconfigure",
data_schema=schema, data_schema=schema,
errors=errors, errors=errors,
) )

View File

@ -32,7 +32,7 @@
"api_key": "[%key:common::config_flow::data::api_key%]" "api_key": "[%key:common::config_flow::data::api_key%]"
} }
}, },
"reconfigure_confirm": { "reconfigure": {
"data": { "data": {
"api_key": "[%key:common::config_flow::data::api_key%]", "api_key": "[%key:common::config_flow::data::api_key%]",
"location": "[%key:common::config_flow::data::location%]" "location": "[%key:common::config_flow::data::location%]"

View File

@ -329,7 +329,7 @@ async def test_reconfigure_flow(
entry.add_to_hass(hass) entry.add_to_hass(hass)
result = await entry.start_reconfigure_flow(hass) result = await entry.start_reconfigure_flow(hass)
assert result["step_id"] == "reconfigure_confirm" assert result["step_id"] == "reconfigure"
assert result["type"] is FlowResultType.FORM assert result["type"] is FlowResultType.FORM
assert result["errors"] == {} assert result["errors"] == {}
@ -427,7 +427,7 @@ async def test_reconfigure_flow_error(
) )
await hass.async_block_till_done() await hass.async_block_till_done()
assert result2["step_id"] == "reconfigure_confirm" assert result2["step_id"] == "reconfigure"
assert result2["type"] is FlowResultType.FORM assert result2["type"] is FlowResultType.FORM
assert result2["errors"] == {error_key: p_error} assert result2["errors"] == {error_key: p_error}