From 9e984dbf02c89969e9e4599bf87cc62560c9d6e9 Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Mon, 7 Oct 2024 10:23:19 -0400 Subject: [PATCH] Update config_flow.py --- custom_components/wyzeapi/config_flow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/wyzeapi/config_flow.py b/custom_components/wyzeapi/config_flow.py index 66d68933..4debb555 100644 --- a/custom_components/wyzeapi/config_flow.py +++ b/custom_components/wyzeapi/config_flow.py @@ -21,7 +21,8 @@ _LOGGER = logging.getLogger(__name__) -STEP_USER_DATA_SCHEMA = vol.Schema({CONF_USERNAME: str, CONF_PASSWORD: str, KEY_ID: str, API_KEY: str}) +STEP_USER_DATA_SCHEMA = vol.Schema({vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str, + vol.Required(KEY_ID): str, vol.Required(API_KEY): str}) STEP_2FA_DATA_SCHEMA = vol.Schema({CONF_ACCESS_TOKEN: str}) class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): @@ -66,7 +67,7 @@ async def async_step_user( ) except CannotConnect: errors["base"] = "cannot_connect" - except InvalidAuth: + except exceptions.AccessTokenError: errors["base"] = "invalid_auth" except exceptions.TwoFactorAuthenticationEnabled: self.user_params[CONF_USERNAME] = user_input[CONF_USERNAME]