2022-03-12 11:36:08 +00:00
|
|
|
"""Config flow to configure the Uptime integration."""
|
2024-03-08 15:35:23 +00:00
|
|
|
|
2022-03-12 11:36:08 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
import voluptuous as vol
|
|
|
|
|
2024-02-29 19:08:16 +00:00
|
|
|
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
|
2022-03-12 11:36:08 +00:00
|
|
|
|
2023-01-20 16:50:32 +00:00
|
|
|
from .const import DOMAIN
|
2022-03-12 11:36:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
class UptimeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|
|
|
"""Config flow for Uptime."""
|
|
|
|
|
|
|
|
VERSION = 1
|
|
|
|
|
|
|
|
async def async_step_user(
|
|
|
|
self, user_input: dict[str, Any] | None = None
|
2024-02-29 19:08:16 +00:00
|
|
|
) -> ConfigFlowResult:
|
2022-03-12 11:36:08 +00:00
|
|
|
"""Handle a flow initialized by the user."""
|
|
|
|
if user_input is not None:
|
|
|
|
return self.async_create_entry(
|
2023-01-20 16:50:32 +00:00
|
|
|
title="Uptime",
|
2022-03-12 11:36:08 +00:00
|
|
|
data={},
|
|
|
|
)
|
|
|
|
|
|
|
|
return self.async_show_form(step_id="user", data_schema=vol.Schema({}))
|