Skip to content

Commit

Permalink
fix: New options flow properties (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
geertmeersman authored Jan 6, 2025
2 parents 46c55e0 + ea1bf31 commit 1ed9948
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions custom_components/robonect/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,21 +501,22 @@ class RobonectOptionsFlow(RobonectCommonFlow, OptionsFlow):

def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize Robonect 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,
)
self.hass.async_create_task(
self.hass.config_entries.async_reload(self.config_entry.entry_id)
)

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 1ed9948

Please sign in to comment.