Fix setting number of digits for verisure lock PIN (#95449)

* Fix error when setting number of digits

* Update test_config_flow.py

Add test for empty code
This commit is contained in:
Olen 2023-06-28 19:18:45 +02:00 committed by GitHub
parent 3d84c6e21c
commit 4959fce1e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -329,7 +329,7 @@ class VerisureOptionsFlowHandler(OptionsFlow):
): int,
vol.Optional(
CONF_LOCK_DEFAULT_CODE,
default=self.entry.options.get(CONF_LOCK_DEFAULT_CODE),
default=self.entry.options.get(CONF_LOCK_DEFAULT_CODE, ""),
): str,
}
),

View file

@ -583,6 +583,15 @@ async def test_reauth_flow_errors(
CONF_LOCK_CODE_DIGITS: DEFAULT_LOCK_CODE_DIGITS,
},
),
(
{
CONF_LOCK_CODE_DIGITS: 5,
},
{
CONF_LOCK_CODE_DIGITS: 5,
CONF_LOCK_DEFAULT_CODE: "",
},
),
],
)
async def test_options_flow(