Use common strings in Icloud config flow (#41188)

This commit is contained in:
scheric 2020-10-04 13:32:53 +02:00 committed by GitHub
parent d5c88a4e3c
commit c3ef05a37e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -113,7 +113,7 @@ class IcloudFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
except PyiCloudFailedLoginException as error:
_LOGGER.error("Error logging into iCloud service: %s", error)
self.api = None
errors[CONF_USERNAME] = "login"
errors[CONF_USERNAME] = "invalid_auth"
return await self._show_setup_form(user_input, errors)
if self.api.requires_2sa:

View File

@ -26,13 +26,13 @@
}
},
"error": {
"login": "Login error: please check your email & password",
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"send_verification_code": "Failed to send verification code",
"validate_verification_code": "Failed to verify your verification code, choose a trust device and start the verification again"
},
"abort": {
"already_configured": "Account already configured",
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
"no_device": "None of your devices have \"Find my iPhone\" activated"
}
}
}
}

View File

@ -275,7 +275,7 @@ async def test_login_failed(hass: HomeAssistantType):
data={CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {CONF_USERNAME: "login"}
assert result["errors"] == {CONF_USERNAME: "invalid_auth"}
async def test_no_device(