diff --git a/homeassistant/components/generic/config_flow.py b/homeassistant/components/generic/config_flow.py index d3b2a260477..ce8caa457ec 100644 --- a/homeassistant/components/generic/config_flow.py +++ b/homeassistant/components/generic/config_flow.py @@ -136,7 +136,7 @@ async def async_test_still(hass, info) -> tuple[dict[str, str], str | None]: try: url = url.async_render(parse_result=False) except TemplateError as err: - _LOGGER.error("Error parsing template %s: %s", url, err) + _LOGGER.warning("Problem rendering template %s: %s", url, err) return {CONF_STILL_IMAGE_URL: "template_error"}, None verify_ssl = info.get(CONF_VERIFY_SSL) auth = generate_auth(info) @@ -283,6 +283,14 @@ class GenericIPCamConfigFlow(ConfigFlow, domain=DOMAIN): if self.check_for_existing(import_config): return self.async_abort(reason="already_exists") errors, still_format = await async_test_still(self.hass, import_config) + if errors.get(CONF_STILL_IMAGE_URL) == "template_error": + _LOGGER.warning( + "Could not render template, but it could be that " + "referenced entities are still initialising. " + "Continuing assuming that imported YAML template is valid" + ) + errors.pop(CONF_STILL_IMAGE_URL) + still_format = import_config.get(CONF_CONTENT_TYPE, "image/jpeg") errors = errors | await async_test_stream(self.hass, import_config) still_url = import_config.get(CONF_STILL_IMAGE_URL) stream_url = import_config.get(CONF_STREAM_SOURCE)