Skip to content

Commit

Permalink
fix: deprecation - new options flow properties
Browse files Browse the repository at this point in the history
  • Loading branch information
geertmeersman committed Jan 10, 2025
1 parent 72db5bd commit ff185b9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions custom_components/nexxtmove/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,24 @@ async def async_step_password(self, user_input: dict | None = None) -> FlowResul
class NexxtmoveOptionsFlow(NexxtmoveCommonFlow, OptionsFlow):
"""Handle Nexxtmove options."""

general_settings: dict

def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize Nexxtmove options flow."""
self.config_entry = config_entry
super().__init__(initial_data=config_entry.data) # type: ignore[arg-type]
super().__init__(initial_data=config_entry.data)

@callback
def finish_flow(self) -> FlowResult:
"""Update the ConfigEntry and finish the flow."""
new_data = DEFAULT_ENTRY_DATA | self.initial_data | self.new_entry_data
self.hass.config_entries.async_update_entry(
self.config_entry,
data=new_data,
title=self.new_title or UNDEFINED,
)

if self.config_entry:
self.hass.config_entries.async_update_entry(
self.config_entry,
data=new_data,
title=self.new_title or UNDEFINED,
)
self.hass.async_create_task(
self.hass.config_entries.async_reload(self._config_entry_id)
)
return self.async_create_entry(title="", data={})

async def async_step_init(
Expand Down

0 comments on commit ff185b9

Please sign in to comment.