Skip to content

Commit

Permalink
Merge pull request #367 from OliverCullimore/ha-custom-component
Browse files Browse the repository at this point in the history
fix: Remove options flow from home assistant custom component
  • Loading branch information
OliverCullimore authored Oct 15, 2023
2 parents bc97aac + 79135fc commit 7a4c483
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions custom_components/uk_bin_collection/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -130,36 +129,3 @@ async def async_step_init(self, user_input=None):
"""Handle a flow initiated by the user."""
_LOGGER.info(LOG_PREFIX + "Initiating flow with user input: %s", user_input)
return await self.async_step_user(user_input)

@staticmethod
@callback
def async_get_options_flow(
config_entry,
) -> config_entries.OptionsFlow:
_LOGGER.info(LOG_PREFIX + "Options flow config_entry: %s", config_entry)
"""Get the options flow for this handler."""
return OptionsFlowHandler(config_entry)


class OptionsFlowHandler(config_entries.OptionsFlow):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry
self.options = dict(config_entry.options)

async def async_step_init(self, user_input=None) -> None:
"""Manage the options."""
if user_input is not None:
_LOGGER.info(LOG_PREFIX + "Options flow user input: %s", user_input)
return self.async_create_entry(title="", data=user_input)

# Access the data from the config_entry parameter
council_data = self.config_entry.data
council_schema = await UkBinCollectionConfigFlow().get_council_schema(
council_data["council"]
)

_LOGGER.info(
LOG_PREFIX + "Showing options form with schema: %s", council_schema
)
return self.async_show_form(step_id="council", data_schema=council_schema)

0 comments on commit 7a4c483

Please sign in to comment.