Use reference strings in Totalconnect (#41047)

* Update strings.json

* Update config_flow.py

* Update test_config_flow.py
This commit is contained in:
SNoof85 2020-10-02 21:45:49 +02:00 committed by GitHub
parent 4ab479d48d
commit f654834d34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -38,7 +38,7 @@ class TotalConnectConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
data={CONF_USERNAME: username, CONF_PASSWORD: password}, data={CONF_USERNAME: username, CONF_PASSWORD: password},
) )
# authentication failed / invalid # authentication failed / invalid
errors["base"] = "login" errors["base"] = "invalid_auth"
data_schema = vol.Schema( data_schema = vol.Schema(
{vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str} {vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str}

View file

@ -10,10 +10,10 @@
} }
}, },
"error": { "error": {
"login": "Login error: please check your username & password" "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
}, },
"abort": { "abort": {
"already_configured": "Account already configured" "already_configured": "[%key:common::config_flow::abort::already_configured_account%]"
} }
} }
} }

View file

@ -100,4 +100,4 @@ async def test_login_failed(hass):
) )
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {"base": "login"} assert result["errors"] == {"base": "invalid_auth"}