Ensure hue options show the defaults when the config options have not yet been saved (#47067)

This commit is contained in:
J. Nick Koston 2021-02-25 23:58:35 -06:00 committed by GitHub
parent 8ab163eda8
commit 6af67c9558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 3 deletions

View file

@ -18,6 +18,8 @@ from .bridge import authenticate_bridge
from .const import ( # pylint: disable=unused-import
CONF_ALLOW_HUE_GROUPS,
CONF_ALLOW_UNREACHABLE,
DEFAULT_ALLOW_HUE_GROUPS,
DEFAULT_ALLOW_UNREACHABLE,
DOMAIN,
LOGGER,
)
@ -246,13 +248,13 @@ class HueOptionsFlowHandler(config_entries.OptionsFlow):
vol.Optional(
CONF_ALLOW_HUE_GROUPS,
default=self.config_entry.options.get(
CONF_ALLOW_HUE_GROUPS, False
CONF_ALLOW_HUE_GROUPS, DEFAULT_ALLOW_HUE_GROUPS
),
): bool,
vol.Optional(
CONF_ALLOW_UNREACHABLE,
default=self.config_entry.options.get(
CONF_ALLOW_UNREACHABLE, False
CONF_ALLOW_UNREACHABLE, DEFAULT_ALLOW_UNREACHABLE
),
): bool,
}