From cd6785f7cb75a3327b97a909ab84decee2c6cbba Mon Sep 17 00:00:00 2001 From: sirmrak Date: Fri, 24 Jul 2026 10:58:50 +0300 Subject: [PATCH] Add custom_components/$REPO_NAME/config_flow.py --- custom_components/$REPO_NAME/config_flow.py | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 custom_components/$REPO_NAME/config_flow.py diff --git a/custom_components/$REPO_NAME/config_flow.py b/custom_components/$REPO_NAME/config_flow.py new file mode 100644 index 0000000..7bdf5b5 --- /dev/null +++ b/custom_components/$REPO_NAME/config_flow.py @@ -0,0 +1,25 @@ +"""Config flow for $REPO_NAME integration.""" +from __future__ import annotations +import logging +from typing import Any +import voluptuous as vol +from homeassistant.config_entries import ConfigFlow +from homeassistant.core import HomeAssistant +from .const import DOMAIN + +_LOGGER = logging.getLogger(__name__) + +STEP_USER_DATA_SCHEMA = vol.Schema({ + vol.Required("host"): str, +}) + +class ConfigFlowHandler(ConfigFlow, domain=DOMAIN): + """Handle a config flow for $REPO_NAME.""" + VERSION = 1 + + async def async_step_user(self, user_input: dict[str, Any] | None = None) -> Any: + """Handle the initial step.""" + errors: dict[str, str] = {} + if user_input is not None: + return self.async_create_entry(title="$REPO_NAME Integration", data=user_input) + return self.async_show_form(step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors) \ No newline at end of file