Skip to content

Commit

Permalink
merge config_flow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JackJPowell committed Dec 11, 2024
1 parent 892f2bd commit b86bdc2
Showing 1 changed file with 10 additions and 33 deletions.
43 changes: 10 additions & 33 deletions custom_components/unfoldedcircle/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ async def async_step_zeroconf_confirm(
# Configure docks and entities
return await self.async_step_dock(info=info, first_call=True)

return self.async_create_entry(title=info["title"], data=info, options=self.options)
return self.async_create_entry(
title=info["title"], data=info, options=self.options
)

return self.async_show_form(
step_id="zeroconf_confirm",
Expand Down Expand Up @@ -469,10 +471,7 @@ async def async_step_reauth_confirm(
await self.hass.config_entries.async_reload(existing_entry.entry_id)
return self.async_abort(reason="reauth_successful")

return self.async_create_entry(
title=info["title"],
data=info
)
return self.async_create_entry(title=info["title"], data=info)

return self.async_show_form(
step_id="reauth_confirm",
Expand All @@ -498,7 +497,9 @@ async def async_step_finish(
"""Complete conflig flow"""
_LOGGER.debug("Create registry entry")
try:
result = self.async_create_entry(title=self.info["title"], data=self.info, options=self.options)
result = self.async_create_entry(
title=self.info["title"], data=self.info, options=self.options
)
_LOGGER.debug("Registry entry creation result : %s", result)
return result
except Exception as ex:
Expand Down Expand Up @@ -921,37 +922,13 @@ async def async_step_select_entities(
)

# Entities sent successfully to the HA driver, store the list in the registry
<<<<<<< HEAD
# If Option flow
if (
isinstance(config_flow, UnfoldedCircleRemoteOptionsFlowHandler)
and config_flow.options
):
if config_flow.options is None:
config_flow.options = {}
config_flow.options["available_entities"] = final_list
if configure_entities_subscription:
config_flow.options["client_id"] = (
subscribed_entities_subscription.client_id
)
elif (
isinstance(config_flow, UnfoldedCircleRemoteConfigFlow)
and config_flow.info
):
if config_flow.info is None:
config_flow.info = {}
config_flow.info["available_entities"] = final_list
if configure_entities_subscription:
config_flow.info["client_id"] = (
subscribed_entities_subscription.client_id
)
=======
if config_flow.options is None:
config_flow.options = {}
config_flow.options["available_entities"] = final_list
if configure_entities_subscription:
config_flow.options["client_id"] = subscribed_entities_subscription.client_id
>>>>>>> 150be07 (Fixed wrong storage location between options and data substructure)
config_flow.options["client_id"] = (
subscribed_entities_subscription.client_id
)

# Subscribe to the new entities if requested by user
if do_subscribed_entities:
Expand Down

0 comments on commit b86bdc2

Please sign in to comment.