diff --git a/homeassistant/components/almond/config_flow.py b/homeassistant/components/almond/config_flow.py index 0421612b702..8a4c5417700 100644 --- a/homeassistant/components/almond/config_flow.py +++ b/homeassistant/components/almond/config_flow.py @@ -51,7 +51,7 @@ class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler): """Handle a flow start.""" # Only allow 1 instance. if self._async_current_entries(): - return self.async_abort(reason="already_setup") + return self.async_abort(reason="single_instance_allowed") return await super().async_step_user(user_input) @@ -79,7 +79,7 @@ class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler): """Import data.""" # Only allow 1 instance. if self._async_current_entries(): - return self.async_abort(reason="already_setup") + return self.async_abort(reason="single_instance_allowed") if not await async_verify_local_connection(self.hass, user_input["host"]): self.logger.warning( @@ -97,7 +97,7 @@ class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler): async def async_step_hassio(self, discovery_info): """Receive a Hass.io discovery.""" if self._async_current_entries(): - return self.async_abort(reason="already_setup") + return self.async_abort(reason="single_instance_allowed") self.hassio_discovery = discovery_info diff --git a/homeassistant/components/almond/strings.json b/homeassistant/components/almond/strings.json index 9c85eeb92c1..b9074ebe4e3 100644 --- a/homeassistant/components/almond/strings.json +++ b/homeassistant/components/almond/strings.json @@ -1,15 +1,17 @@ { "config": { "step": { - "pick_implementation": { "title": "[%key:common::config_flow::title::oauth2_pick_implementation%]" }, + "pick_implementation": { + "title": "[%key:common::config_flow::title::oauth2_pick_implementation%]" + }, "hassio_confirm": { "title": "Almond via Hass.io add-on", "description": "Do you want to configure Home Assistant to connect to Almond provided by the Hass.io add-on: {addon}?" } }, "abort": { - "already_setup": "You can only configure one Almond account.", - "cannot_connect": "Unable to connect to the Almond server.", + "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]", + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", "missing_configuration": "Please check the documentation on how to set up Almond.", "no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]" } diff --git a/tests/components/almond/test_config_flow.py b/tests/components/almond/test_config_flow.py index 49694d84410..b2144205895 100644 --- a/tests/components/almond/test_config_flow.py +++ b/tests/components/almond/test_config_flow.py @@ -80,15 +80,15 @@ async def test_abort_if_existing_entry(hass): result = await flow.async_step_user() assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "already_setup" + assert result["reason"] == "single_instance_allowed" result = await flow.async_step_import() assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "already_setup" + assert result["reason"] == "single_instance_allowed" result = await flow.async_step_hassio({}) assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "already_setup" + assert result["reason"] == "single_instance_allowed" async def test_full_flow(hass, aiohttp_client, aioclient_mock, current_request):