diff --git a/homeassistant/components/generic/config_flow.py b/homeassistant/components/generic/config_flow.py index af33ae3b36f..6e287c424b9 100644 --- a/homeassistant/components/generic/config_flow.py +++ b/homeassistant/components/generic/config_flow.py @@ -361,6 +361,10 @@ class GenericIPCamConfigFlow(ConfigFlow, domain=DOMAIN): self.user_input = user_input self.title = name + if still_url is None: + return self.async_create_entry( + title=self.title, data={}, options=self.user_input + ) # temporary preview for user to check the image self.context["preview_cam"] = user_input return await self.async_step_user_confirm_still() diff --git a/tests/components/generic/test_config_flow.py b/tests/components/generic/test_config_flow.py index 841fb710717..7e76d8f3891 100644 --- a/tests/components/generic/test_config_flow.py +++ b/tests/components/generic/test_config_flow.py @@ -409,16 +409,9 @@ async def test_form_only_stream( user_flow["flow_id"], data, ) - assert result1["type"] is FlowResultType.FORM - assert result1["step_id"] == "user_confirm_still" - result3 = await hass.config_entries.flow.async_configure( - result1["flow_id"], - user_input={CONF_CONFIRMED_OK: True}, - ) - await hass.async_block_till_done() - assert result3["type"] is FlowResultType.CREATE_ENTRY - assert result3["title"] == "127_0_0_1" - assert result3["options"] == { + assert result1["type"] is FlowResultType.CREATE_ENTRY + assert result1["title"] == "127_0_0_1" + assert result1["options"] == { CONF_AUTHENTICATION: HTTP_BASIC_AUTHENTICATION, CONF_STREAM_SOURCE: "rtsp://user:pass@127.0.0.1/testurl/2", CONF_USERNAME: "fred_flintstone",