Use reference strings in Withings (#41345)

This commit is contained in:
SNoof85 2020-10-07 11:22:11 +02:00 committed by GitHub
parent 21655e93bf
commit 04b04027c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -70,7 +70,7 @@ class WithingsFlowHandler(
self._current_data = {} self._current_data = {}
return await self.async_step_finish(new_data) return await self.async_step_finish(new_data)
errors["base"] = "profile_exists" errors["base"] = "already_configured_account"
return self.async_show_form( return self.async_show_form(
step_id="profile", step_id="profile",

View File

@ -14,14 +14,16 @@
} }
}, },
"error": { "error": {
"profile_exists": "User profile is already configured. Please provide a unique profile name." "already_configured_account": "[%key:common::config_flow::abort::already_configured_account%]"
}, },
"abort": { "abort": {
"authorize_url_timeout": "Timeout generating authorize url.", "authorize_url_timeout": "[%key:common::config_flow::abort::oauth2_authorize_url_timeout%]",
"missing_configuration": "The Withings integration is not configured. Please follow the documentation.", "missing_configuration": "[%key:common::config_flow::abort::oauth2_missing_configuration%]",
"already_configured": "Configuration updated for profile.", "already_configured": "Configuration updated for profile.",
"no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]" "no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]"
}, },
"create_entry": { "default": "Successfully authenticated with Withings." } "create_entry": {
"default": "Successfully authenticated with Withings."
}
} }
} }

View File

@ -30,7 +30,7 @@ async def test_config_non_unique_profile(hass: HomeAssistant) -> None:
) )
assert result assert result
assert result["errors"]["base"] == "profile_exists" assert result["errors"]["base"] == "already_configured_account"
async def test_config_reauth_profile( async def test_config_reauth_profile(