Use reference strings in rainmachine (#41216)

This commit is contained in:
SNoof85 2020-10-05 15:29:27 +02:00 committed by GitHub
parent f50976a0b3
commit b7ff0a5a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -69,7 +69,7 @@ class RainMachineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
ssl=user_input.get(CONF_SSL, True), ssl=user_input.get(CONF_SSL, True),
) )
except RainMachineError: except RainMachineError:
return await self._show_form({CONF_PASSWORD: "invalid_credentials"}) return await self._show_form({CONF_PASSWORD: "invalid_auth"})
# Unfortunately, RainMachine doesn't provide a way to refresh the # Unfortunately, RainMachine doesn't provide a way to refresh the
# access token without using the IP address and password, so we have to # access token without using the IP address and password, so we have to

View File

@ -11,11 +11,11 @@
} }
}, },
"error": { "error": {
"identifier_exists": "Account already registered", "identifier_exists": "[%key:common::config_flow::abort::already_configured_account%]",
"invalid_credentials": "Invalid credentials" "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
}, },
"abort": { "abort": {
"already_configured": "This RainMachine controller is already configured." "already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
} }
} }
} }

View File

@ -54,7 +54,7 @@ async def test_invalid_password(hass):
side_effect=RainMachineError, side_effect=RainMachineError,
): ):
result = await flow.async_step_user(user_input=conf) result = await flow.async_step_user(user_input=conf)
assert result["errors"] == {CONF_PASSWORD: "invalid_credentials"} assert result["errors"] == {CONF_PASSWORD: "invalid_auth"}
async def test_show_form(hass): async def test_show_form(hass):