Fix defaults

This commit is contained in:
G Johansson 2024-11-24 21:40:54 +00:00
parent 1a2c59ffeb
commit 48f44ab883

View File

@ -70,6 +70,7 @@ class OptionsFlowHandler(OptionsFlow):
if user_input is not None:
return self.async_create_entry(data=self.config_entry.options | user_input)
section_1 = self.config_entry.options.get("section_1", {})
return self.async_show_form(
step_id="options_1",
data_schema=vol.Schema(
@ -79,15 +80,11 @@ class OptionsFlowHandler(OptionsFlow):
{
vol.Optional(
CONF_BOOLEAN,
default=self.config_entry.options.get(
"section_1", {}
).get(CONF_BOOLEAN, False),
default=section_1.get(CONF_BOOLEAN, False),
): bool,
vol.Optional(
CONF_INT,
self.config_entry.options.get("section_1", {}).get(
CONF_INT, 10
),
default=section_1.get(CONF_INT, 10),
): int,
}
),