2019-12-31 13:34:53 +00:00
|
|
|
"""Config flow for local_ip."""
|
2021-05-27 12:04:40 +00:00
|
|
|
from __future__ import annotations
|
2019-12-31 13:34:53 +00:00
|
|
|
|
2021-05-27 12:04:40 +00:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
from homeassistant.config_entries import ConfigFlow
|
|
|
|
from homeassistant.data_entry_flow import FlowResult
|
2019-12-31 13:34:53 +00:00
|
|
|
|
2020-04-09 14:06:01 +00:00
|
|
|
from .const import DOMAIN
|
2019-12-31 13:34:53 +00:00
|
|
|
|
|
|
|
|
2021-05-27 12:04:40 +00:00
|
|
|
class SimpleConfigFlow(ConfigFlow, domain=DOMAIN):
|
2019-12-31 13:34:53 +00:00
|
|
|
"""Handle a config flow for local_ip."""
|
|
|
|
|
|
|
|
VERSION = 1
|
|
|
|
|
2021-05-27 12:04:40 +00:00
|
|
|
async def async_step_user(
|
|
|
|
self, user_input: dict[str, Any] | None = None
|
|
|
|
) -> FlowResult:
|
2019-12-31 13:34:53 +00:00
|
|
|
"""Handle the initial step."""
|
2020-04-09 14:06:01 +00:00
|
|
|
if self._async_current_entries():
|
|
|
|
return self.async_abort(reason="single_instance_allowed")
|
|
|
|
|
|
|
|
if user_input is None:
|
|
|
|
return self.async_show_form(step_id="user")
|
|
|
|
|
|
|
|
return self.async_create_entry(title=DOMAIN, data=user_input)
|