apply small feedback suggestions from a previous PR that is already merged (#37551)

This commit is contained in:
Eugene Prystupa authored and GitHub committed 2020-07-06 20:09:56 -05:00
1 parent 27ef8a1ced
commit e5872cc0e4
3 files changed
+3 -6

No files matched your search

+2 -2
View File
@@ -51,8 +51,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
if user_input is not None:
try:
info = await validate_input(self.hass, user_input)
return self.async_create_entry(title=info["title"], data=user_input)
except CannotConnect:
errors["base"] = "cannot_connect"
except InvalidAuth:
@@ -60,6 +58,8 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
except Exception: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception")
errors["base"] = "unknown"
else:
return self.async_create_entry(title=info["title"], data=user_input)
return self.async_show_form(
step_id="user", data_schema=DATA_SCHEMA, errors=errors