mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix Yale optionsflow (#65072)
This commit is contained in:
parent
696b930b1c
commit
e92078cf50
@ -161,7 +161,10 @@ class YaleOptionsFlowHandler(OptionsFlow):
|
||||
errors = {}
|
||||
|
||||
if user_input:
|
||||
if len(user_input[CONF_CODE]) not in [0, user_input[CONF_LOCK_CODE_DIGITS]]:
|
||||
if len(user_input.get(CONF_CODE, "")) not in [
|
||||
0,
|
||||
user_input[CONF_LOCK_CODE_DIGITS],
|
||||
]:
|
||||
errors["base"] = "code_format_mismatch"
|
||||
else:
|
||||
return self.async_create_entry(title="", data=user_input)
|
||||
@ -171,7 +174,10 @@ class YaleOptionsFlowHandler(OptionsFlow):
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
vol.Optional(
|
||||
CONF_CODE, default=self.entry.options.get(CONF_CODE)
|
||||
CONF_CODE,
|
||||
description={
|
||||
"suggested_value": self.entry.options.get(CONF_CODE)
|
||||
},
|
||||
): str,
|
||||
vol.Optional(
|
||||
CONF_LOCK_CODE_DIGITS,
|
||||
|
Loading…
x
Reference in New Issue
Block a user