From 0a3db42d618d534965165081d3eadbf48fc7deba Mon Sep 17 00:00:00 2001 From: scheric <38077357+scheric@users.noreply.github.com> Date: Mon, 5 Oct 2020 13:53:11 +0200 Subject: [PATCH] Use common strings in Ecobee config flow (#41257) * Update common Strings * one_instance_only -> single_instance_allowed --- homeassistant/components/ecobee/config_flow.py | 2 +- homeassistant/components/ecobee/strings.json | 4 ++-- tests/components/ecobee/test_config_flow.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/ecobee/config_flow.py b/homeassistant/components/ecobee/config_flow.py index cbe16832a34..6641181b7e4 100644 --- a/homeassistant/components/ecobee/config_flow.py +++ b/homeassistant/components/ecobee/config_flow.py @@ -29,7 +29,7 @@ class EcobeeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Handle a flow initiated by the user.""" if self._async_current_entries(): # Config entry already exists, only one allowed. - return self.async_abort(reason="one_instance_only") + return self.async_abort(reason="single_instance_allowed") errors = {} stored_api_key = ( diff --git a/homeassistant/components/ecobee/strings.json b/homeassistant/components/ecobee/strings.json index b80996cb2a3..78f0708134c 100644 --- a/homeassistant/components/ecobee/strings.json +++ b/homeassistant/components/ecobee/strings.json @@ -18,7 +18,7 @@ "token_request_failed": "Error requesting tokens from ecobee; please try again." }, "abort": { - "one_instance_only": "This integration currently supports only one ecobee instance." + "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]" } } -} \ No newline at end of file +} diff --git a/tests/components/ecobee/test_config_flow.py b/tests/components/ecobee/test_config_flow.py index 6b53af5daa8..88b7eb7241d 100644 --- a/tests/components/ecobee/test_config_flow.py +++ b/tests/components/ecobee/test_config_flow.py @@ -26,7 +26,7 @@ async def test_abort_if_already_setup(hass): result = await flow.async_step_user() assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "one_instance_only" + assert result["reason"] == "single_instance_allowed" async def test_user_step_without_user_input(hass):