Skip to content

Commit

Permalink
Merge pull request #636 from brg468/config-flow-update
Browse files Browse the repository at this point in the history
Update Config Flow
  • Loading branch information
SecKatie authored Oct 8, 2024
2 parents 40c3792 + 09a7854 commit 8a75573
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/wyzeapi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 8a75573

Please sign in to comment.