Skip to content

Commit

Permalink
Adapt options flow to support password mode
Browse files Browse the repository at this point in the history
  • Loading branch information
txxa committed Oct 6, 2024
1 parent baca675 commit 98b0ed6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions custom_components/duplicati/options_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,15 @@ async def async_step_init(
"""Manage the options."""
try:
errors: dict[str, str] = {}
self.backups = await self._async_get_backups()
available_backups = self._get_available_backups()
available_backups_list = self._get_backup_select_options_list(
available_backups
)
configured_backups = list(
self.config_entry.data.get(CONF_BACKUPS, {}).keys()
)
configured_scan_interval = self.config_entry.data.get(
CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL
)
available_backups = self.config_entry.data.get(CONF_BACKUPS, {})
self.backups = await self._async_get_backups()
available_backups = self._get_available_backups()
except CannotConnect as e:
_LOGGER.error("Failed to connect: %s", str(e))
errors["base"] = "cannot_connect"
Expand All @@ -166,6 +164,10 @@ async def async_step_init(
except Exception:
_LOGGER.exception("Unexpected exception")
errors["base"] = "unknown"
finally:
available_backups_list = self._get_backup_select_options_list(
available_backups
)

# Process user input if provided
if user_input is not None:
Expand Down

0 comments on commit 98b0ed6

Please sign in to comment.