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