Skip to content

Commit

Permalink
Fix options flow
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasddn committed Dec 23, 2024
1 parent bba56fd commit de35e31
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/volvo_cars/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def async_get_options_flow(
config_entry: ConfigEntry,
) -> OptionsFlowHandler:
"""Create the options flow."""
return OptionsFlowHandler()
return OptionsFlowHandler(config_entry)

async def _async_authenticate(
self, vin: str, user_input: dict[str, Any], errors: dict[str, str]
Expand Down Expand Up @@ -232,7 +232,9 @@ async def _async_create_or_update_entry(self) -> ConfigFlowResult:
)


class OptionsFlowHandler(config_entries.OptionsFlow):
# OptionsFlowWithConfigEntry is being phased out, probably in 2025.12.
# Use OptionsFlow instead, starting from 2024.12.
class OptionsFlowHandler(config_entries.OptionsFlowWithConfigEntry):
"""Class to handle the options."""

async def async_step_init(
Expand Down Expand Up @@ -285,5 +287,7 @@ async def async_step_init(

return self.async_show_form(
step_id="init",
data_schema=vol.Schema(schema),
data_schema=self.add_suggested_values_to_schema(
vol.Schema(schema), self.config_entry.options
),
)

0 comments on commit de35e31

Please sign in to comment.