Use reference strings in Notion (#41211)

This commit is contained in:
SNoof85 2020-10-05 15:13:37 +02:00 committed by GitHub
parent 20a136e2a1
commit c7027e2828
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -47,6 +47,6 @@ class NotionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
user_input[CONF_USERNAME], user_input[CONF_PASSWORD], session user_input[CONF_USERNAME], user_input[CONF_PASSWORD], session
) )
except NotionError: except NotionError:
return await self._show_form({"base": "invalid_credentials"}) return await self._show_form({"base": "invalid_auth"})
return self.async_create_entry(title=user_input[CONF_USERNAME], data=user_input) return self.async_create_entry(title=user_input[CONF_USERNAME], data=user_input)

View file

@ -10,11 +10,11 @@
} }
}, },
"error": { "error": {
"invalid_credentials": "Invalid username or password", "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"no_devices": "No devices found in account" "no_devices": "No devices found in account"
}, },
"abort": { "abort": {
"already_configured": "This username is already in use." "already_configured": "[%key:common::config_flow::abort::already_configured_account%]"
} }
} }
} }

View file

@ -53,7 +53,7 @@ async def test_invalid_credentials(hass, mock_aionotion):
flow.context = {"source": SOURCE_USER} flow.context = {"source": SOURCE_USER}
result = await flow.async_step_user(user_input=conf) result = await flow.async_step_user(user_input=conf)
assert result["errors"] == {"base": "invalid_credentials"} assert result["errors"] == {"base": "invalid_auth"}
async def test_show_form(hass): async def test_show_form(hass):