mirror of
https://github.com/thekiwismarthome/shopping-list-manager.git
synced 2026-06-30 21:46:30 +00:00
fix config screen access #7
This commit is contained in:
@@ -50,7 +50,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
|
|
||||||
def __init__(self, config_entry):
|
def __init__(self, config_entry):
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self._config_entry = config_entry
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None):
|
async def async_step_init(self, user_input=None):
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
@@ -59,9 +59,9 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
return self.async_create_entry(title="", data=user_input)
|
return self.async_create_entry(title="", data=user_input)
|
||||||
|
|
||||||
# Get current settings
|
# Get current settings
|
||||||
current_country = self.config_entry.options.get(
|
current_country = self._config_entry.options.get(
|
||||||
"country",
|
"country",
|
||||||
self.config_entry.data.get("country", "NZ")
|
self._config_entry.data.get("country", "NZ")
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
@@ -76,15 +76,15 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
}),
|
}),
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
"enable_price_tracking",
|
"enable_price_tracking",
|
||||||
default=self.config_entry.options.get("enable_price_tracking", True)
|
default=self._config_entry.options.get("enable_price_tracking", True)
|
||||||
): bool,
|
): bool,
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
"enable_image_search",
|
"enable_image_search",
|
||||||
default=self.config_entry.options.get("enable_image_search", True)
|
default=self._config_entry.options.get("enable_image_search", True)
|
||||||
): bool,
|
): bool,
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
"metric_units_only",
|
"metric_units_only",
|
||||||
default=self.config_entry.options.get("metric_units_only", True)
|
default=self._config_entry.options.get("metric_units_only", True)
|
||||||
): bool,
|
): bool,
|
||||||
}),
|
}),
|
||||||
description_placeholders={
|
description_placeholders={
|
||||||
|
|||||||
Reference in New Issue
Block a user