Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: G Johansson <[email protected]>
  • Loading branch information
asymworks and gjohansson-ST committed Aug 6, 2023
1 parent d653167 commit 5400000
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions homeassistant/components/airnow/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,24 @@ def async_get_options_flow(
class OptionsFlowHandler(config_entries.OptionsFlowWithConfigEntry):
"""Handle an options flow for AirNow."""

async def async_step_init(self, user_input):
async def async_step_init(self, user_input: dict[str,Any] | None = None) -> FlowResult:
"""Manage the options."""
if user_input is not None:
return self.async_create_entry(data=user_input)

return self.async_show_form(
step_id="init",
data_schema=self.add_suggested_values_to_schema(
vol.Schema(
options_schema = vol.Schema(
{
vol.Optional(
CONF_RADIUS,
default=self.config_entry.options.get(CONF_RADIUS),
CONF_RADIUS
): vol.All(
int,
vol.Range(min=5),
),
}
),
{CONF_RADIUS: self.config_entry.options[CONF_RADIUS]},
),
)
)
data_schema=self.add_suggested_values_to_schema(options_schema, self.entry.options)


class CannotConnect(exceptions.HomeAssistantError):
Expand Down

0 comments on commit 5400000

Please sign in to comment.