diff --git a/homeassistant/components/intellifire/config_flow.py b/homeassistant/components/intellifire/config_flow.py index f5599bfb9b1..6066d703729 100644 --- a/homeassistant/components/intellifire/config_flow.py +++ b/homeassistant/components/intellifire/config_flow.py @@ -128,21 +128,22 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): } ) - if user_input[CONF_USERNAME] != "": - try: - return await self.validate_api_access_and_create_or_update( - host=self._host, - username=user_input[CONF_USERNAME], - password=user_input[CONF_PASSWORD], - serial=self._serial, - ) + try: + return await self.validate_api_access_and_create_or_update( + host=self._host, + username=user_input[CONF_USERNAME], + password=user_input[CONF_PASSWORD], + serial=self._serial, + ) - except (ConnectionError, ClientConnectionError): - errors["base"] = "iftapi_connect" - LOGGER.info("ERROR: iftapi_connect") - except LoginException: - errors["base"] = "api_error" - LOGGER.info("ERROR: api_error") + except (ConnectionError, ClientConnectionError): + errors["base"] = "iftapi_connect" + LOGGER.error( + "Could not connect to iftapi.net over https - verify connectivity" + ) + except LoginException: + errors["base"] = "api_error" + LOGGER.error("Invalid credentials for iftapi.net") return self.async_show_form( step_id="api_config", errors=errors, data_schema=control_schema diff --git a/homeassistant/components/intellifire/strings.json b/homeassistant/components/intellifire/strings.json index f73869182c0..dd5c66adebd 100644 --- a/homeassistant/components/intellifire/strings.json +++ b/homeassistant/components/intellifire/strings.json @@ -5,7 +5,7 @@ "manual_device_entry": { "description": "Local Configuration", "data": { - "host": "[%key:common::config_flow::data::host%] (IP Address)" + "host": "Host (IP Address)" } }, "api_config": { diff --git a/tests/components/intellifire/test_config_flow.py b/tests/components/intellifire/test_config_flow.py index b277a5b0f51..2f48e645708 100644 --- a/tests/components/intellifire/test_config_flow.py +++ b/tests/components/intellifire/test_config_flow.py @@ -299,17 +299,14 @@ async def test_reauth_flow( assert result["type"] == RESULT_TYPE_FORM assert result["step_id"] == "api_config" - with patch( - "homeassistant.config_entries.ConfigFlow.async_set_unique_id", - return_value=entry, - ): - - result3 = await hass.config_entries.flow.async_configure( - result["flow_id"], - {CONF_USERNAME: "test", CONF_PASSWORD: "AROONIE"}, - ) + result3 = await hass.config_entries.flow.async_configure( + result["flow_id"], + {CONF_USERNAME: "test", CONF_PASSWORD: "AROONIE"}, + ) await hass.async_block_till_done() assert result3["type"] == RESULT_TYPE_ABORT + assert entry.data[CONF_PASSWORD] == "AROONIE" + assert entry.data[CONF_USERNAME] == "test" async def test_dhcp_discovery_intellifire_device(