Use common strings in Ecobee config flow (#41257)

* Update common Strings

* one_instance_only -> single_instance_allowed
This commit is contained in:
scheric 2020-10-05 13:53:11 +02:00 committed by GitHub
parent 5f695e789b
commit 0a3db42d61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ class EcobeeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a flow initiated by the user.""" """Handle a flow initiated by the user."""
if self._async_current_entries(): if self._async_current_entries():
# Config entry already exists, only one allowed. # Config entry already exists, only one allowed.
return self.async_abort(reason="one_instance_only") return self.async_abort(reason="single_instance_allowed")
errors = {} errors = {}
stored_api_key = ( stored_api_key = (

View file

@ -18,7 +18,7 @@
"token_request_failed": "Error requesting tokens from ecobee; please try again." "token_request_failed": "Error requesting tokens from ecobee; please try again."
}, },
"abort": { "abort": {
"one_instance_only": "This integration currently supports only one ecobee instance." "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]"
} }
} }
} }

View file

@ -26,7 +26,7 @@ async def test_abort_if_already_setup(hass):
result = await flow.async_step_user() result = await flow.async_step_user()
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT 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): async def test_user_step_without_user_input(hass):