From 5a3d52816a73209150943145aa3eaf16100c23e7 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Oct 2020 19:50:49 -0400 Subject: [PATCH] fix config flow strings --- custom_components/pyscript/config_flow.py | 2 +- custom_components/pyscript/strings.json | 4 ++-- custom_components/pyscript/translations/en.json | 4 ++-- tests/test_config_flow.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/pyscript/config_flow.py b/custom_components/pyscript/config_flow.py index 2fe7b42..2da34a0 100644 --- a/custom_components/pyscript/config_flow.py +++ b/custom_components/pyscript/config_flow.py @@ -62,6 +62,6 @@ async def async_step_import(self, import_config: Dict[str, Any] = None) -> Dict[ self.hass.config_entries.async_update_entry(entry=entry, data=updated_data) return self.async_abort(reason="updated_entry") - return self.async_abort(reason="already_configured_service") + return self.async_abort(reason="already_configured") return await self.async_step_user(user_input=import_config) diff --git a/custom_components/pyscript/strings.json b/custom_components/pyscript/strings.json index 3f13345..47dd727 100644 --- a/custom_components/pyscript/strings.json +++ b/custom_components/pyscript/strings.json @@ -10,8 +10,8 @@ } }, "abort": { - "already_configured_service": "[%key:common::config_flow::abort::already_configured_service%]", - "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]", + "already_configured": "Already configured.", + "single_instance_allowed": "Already configured. Only a single configuration possible.", "updated_entry": "This entry has already been setup but the configuration has been updated." } } diff --git a/custom_components/pyscript/translations/en.json b/custom_components/pyscript/translations/en.json index 3f13345..47dd727 100644 --- a/custom_components/pyscript/translations/en.json +++ b/custom_components/pyscript/translations/en.json @@ -10,8 +10,8 @@ } }, "abort": { - "already_configured_service": "[%key:common::config_flow::abort::already_configured_service%]", - "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]", + "already_configured": "Already configured.", + "single_instance_allowed": "Already configured. Only a single configuration possible.", "updated_entry": "This entry has already been setup but the configuration has been updated." } } diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index cdaca30..4b54607 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -134,7 +134,7 @@ async def test_import_flow_no_update(hass): ) assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "already_configured_service" + assert result["reason"] == "already_configured" async def test_import_flow_update_user(hass):