Skip to content

Commit

Permalink
finish up config flow for options
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Apr 13, 2023
1 parent 41b9f2b commit 8e3d4e5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions custom_components/nws_alerts/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ async def async_step_gps_loc(self, user_input={}):
self._data.update(user_input)
return self.async_create_entry(title="", data=self._data)
return await self._show_options_form(user_input)

async def async_step_gps_tracker(self, user_input={}):
"""Handle a flow initialized by the user."""
self._errors = {}

if user_input is not None:
self._data.update(user_input)
return self.async_create_entry(title="", data=self._data)
return await self._show_options_form(user_input)

async def async_step_zone(self, user_input={}):
"""Handle a flow initialized by the user."""
Expand All @@ -313,3 +322,9 @@ async def _show_options_form(self, user_input):
data_schema=_get_schema_zone(self.hass, user_input, self._data),
errors=self._errors,
)
elif CONF_TRACKER in self.config.data:
return self.async_show_form(
step_id="gps_tracker",
data_schema=_get_schema_tracker(self.hass, user_input, self._data),
errors=self._errors,
)

0 comments on commit 8e3d4e5

Please sign in to comment.